#B2031. Triangle Area Calculation
Triangle Area Calculation
Triangle Area Calculation
Given three vertices of a triangle on a plane with coordinates \((x_1, y_1)\), \((x_2, y_2)\), and \((x_3, y_3)\), compute the area of the triangle.
The area \(A\) of the triangle can be calculated by the formula:
$$ A = \frac{1}{2} \left| x_1(y_2-y_3) + x_2(y_3-y_1) + x_3(y_1-y_2) \right| $$
inputFormat
The input consists of one line containing six numbers: x1 y1 x2 y2 x3 y3
, representing the coordinates of the three vertices of the triangle.
outputFormat
Output the area of the triangle as a floating-point number rounded to one decimal place.
sample
0 0 1 0 0 1
0.5