#include #include #include int main () { float x1, y1, x2, y2, x3, y3; float a, b, c; float s; float A; /* Read the coordinates of the three vertices */ printf("(x1,y1) = "); scanf("%f%f", &x1, &y1); printf("(x2,y2) = "); scanf("%f%f", &x2, &y2); printf("(x3,y3) = "); scanf("%f%f", &x3, &y3); /* Compute the lengths of the sides */ a = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)); b = sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)); c = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); /* Compute the semiperimeter */ s = (a + b + c) / 2; /* Compute the area */ A = sqrt(s*(s-a)*(s-b)*(s-c)); /* Report the area */ printf("Area = %f\n", A); exit(0); }