#include <iostream>
#include <math.h>
 
using namespace std;
 
class Punt {
    int x, y;
    public:
        Punt();
        Punt(int, int);
        ~Punt() {};
        int getx() {return x;}
        int gety() {return y;}
};
 
Punt::Punt(){}
 
Punt::Punt(int px, int py) {
    x = px;
    y = py;
}
 
class Driehoek {
    Punt a,b,c;
    public:
        Driehoek(Punt,Punt,Punt);
        ~Driehoek() {};
        Punt getA() {return a;}
        Punt getB() {return b;}
        Punt getC() {return c;}
 
        float getDist(int type) {
            float dist;
            switch(type){
                case 1:
                    dist = sqrt(pow((a.getx()-b.getx()),2) + pow((a.gety()-b.gety()),2));
                break;
                case 2:
                    dist = sqrt(pow((b.getx()-c.getx()),2) + pow((b.gety()-c.gety()),2));
                break;
                case 3:
                    dist = sqrt(pow((c.getx()-a.getx()),2) + pow((c.gety()-a.gety()),2));
                break;
            }
 
            if(dist < 0)
                dist = dist - (dist*2);
            return dist;
        }
 
        void printDetails() {
            cout << endl << "Driehoek:" << endl;
            cout << "punt a: (" << a.getx() << "," << a.gety() << ")" << endl;
            cout << "punt b: (" << b.getx() << "," << b.gety() << ")" << endl;
            cout << "punt c: (" << c.getx() << "," << c.gety() << ")" << endl;
            cout << "ab: " << getDist(1) << endl;
            cout << "bc: " << getDist(2) << endl;
            cout << "ca: " << getDist(3) << endl;
            cout << "surface: " << surface() << endl;
        }
 
        float surface() {
            float surf;
            float a = getDist(1);
            float b = getDist(3);
            float c = getDist(2);
            float s = (a + b + c) / 2;
            surf = sqrt(s * ((s-a) * (s-b) * (s-c)));
            return surf;
        }
};
 
Driehoek::Driehoek(Punt pa, Punt pb, Punt pc) {
    a = pa;
    b = pb;
    c = pc;
}
 
int main() {
    Punt pA(7,5);
    Punt pB(3,4);
    Punt pC(5,8);
    Driehoek dh(pA,pB,pC);
    dh.printDetails();
	return 0;
}