Code
#include<iostream>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
float x1 = 2.3,y1 = 2.5;
float x2 = 6.4,y2 = 3.1;
float x3 = 5.1,y3 = 7.2;
float a = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
float b = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
float c = sqrt(pow(x3-x2,2)+pow(y3-y2,2));
double p=(a+b+c)/2.0;
double s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("%.3lf",s);
return 0;
}
Answer
8.795