#include #include #include "triangle.h" using namespace std; double Triangle::area() { // fabs(x1*(y2-y3) + x2*(y3 - y1) + x3(y1-y2))/2 double x1 = vertices[0].getX(); double y1 = vertices[0].getY(); double x2 = vertices[1].getX(); double y2 = vertices[1].getY(); double x3 = vertices[2].getX(); double y3 = vertices[2].getY(); return fabs(x1*(y2-y3) + x2*(y3 - y1) + x3*(y1-y2))/2; } void Triangle::print() { cout<<"Name: "<