#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
class point
{
private:
int x, y;
public:
point(){}
point(int tx, int ty){x=tx;y=ty;}
int getx(){return x;}
int gety(){return y;}
};
void main()
{
point pointer;
int tempX,tempY;
double a, b, c, s, area;
cout<<"Enter the x coordinator for 1st point";
cin>>tempX;
cout<<"Enter the y coordinator for 1st point";
cin>>tempY;
point p(tempX,tempY);
cout<<"\nEnter the x coordinator for 2nd point";
cin>>tempX;
cout<<"Enter the y coordinator for 2nd point";
cin>>tempY;
point p1(tempX,tempY);
cout<<"\nEnter the x coordinator for 3rd point";
cin>>tempX;
cout<<"Enter the y coordinator for 3rd point";
cin>>tempY;
point p2(tempX,tempY);
if(p.getx()==p1.getx() && p1.getx()==p2.getx() || (p.gety()==p1.gety() && p1.gety()==p2.gety()))
cout<<"\nThe points are collinear"<<endl;
else{
/* Compute distance between p1 and p2. */
a = sqrt((p1.getx() - p.getx())*(p1.getx() - p.getx()) + (p1.gety() - p.gety())*(p1.gety() - p.gety()));
/* Print distance. */
cout<<"Distance between points p1 and p2: "<<a<<endl;
/* Compute distance between p2 and p3. */
b = sqrt((p2.getx() - p1.getx())*(p2.getx() - p1.getx()) + (p2.gety() - p1.gety())*(p2.gety() - p1.gety()));
/* Print distance. */
cout<<"Distance between points p2 and p3: "<<b<<endl;
/* Compute distance between p1 and p3. */
c = sqrt((p2.getx() - p.getx())*(p2.getx() - p.getx()) + (p2.gety() - p.gety())*(p2.gety() - p.gety()));
/* Print distance. */
cout<<"Distance between points p1 and p3: "<<c<<endl;
s = 0.5*( a + b + c );
area = sqrt( s*(s-a)*(s-b)*(s-c) );
cout<<"The area of the <strong class="highlight">triangle</strong> is : "<<area<<endl;
if(a==b && b==c && a==c)
cout<<"It is an equilateral <strong class="highlight">triangle</strong>."<<endl;
else
if(a==b || b==c || a==c)
cout<<"It is an isosceles <strong class="highlight">triangle</strong>."<<endl;
else
if(c==sqrt(a*a + b*b) || a==sqrt(b*b + c*c) || b==sqrt(a*a + c*c))
cout<<"It is a right-angled <strong class="highlight">triangle</strong>."<<endl;
}
}