#t218. 计算三角形面积
计算三角形面积
Area of a Triangle
Problem Description
Given a triangle on the plane whose three vertices have coordinates , compute the area of this triangle.
Input Format
A single line containing floating-point numbers, corresponding to .
Output Format
A single line containing the area of the triangle, accurate to two decimal places.
Sample Input
0 0 4 0 0 3
Sample Output
6.00
Hint
- There are 6 numbers in the input: the coordinates of the three vertices.
- You cannot plug the coordinates directly into Heron's formula — first compute the three side lengths (use the distance-between-two-points formula), then follow the procedure from the previous problem.
- Keep 2 decimal places. Check against the sample:
0 0 4 0 0 3→ side lengths 3, 4, 5 →6.00.
Heron's formula: let the three side lengths be , set , then the area .