| CodeRams Practice Problem Archive |
|---|
| Finished |
You have a triangle with three points given in coordinates. Given this information, figure out the triangle's area. The points can be given in any order.
To calculate the area of a triangle, you can use Heron's Formula, which is described below:
Define $$$A$$$, $$$B$$$, and $$$C$$$ to be the lengths of the three sides of the triangle.
Define $$$S$$$ to be equal to $$$\frac{A + B + C}{2}$$$.
Then, the area of the triangle is calculated as $$$\sqrt{S(S - A)(S - B)(S - C)}$$$.
The input consists of three lines, each consisting of two space-separated integers $$$x$$$ and $$$y$$$: the coordinates of each point of the triangle.
Output a single decimal number $$$a$$$: the area of the triangle, using Heron's Formula as described above. Do not round your answer.
1 1 5 4 2 8
12.5
0 0 8 0 4 8
32.0
-1 -3 2 7 9 -11
62.0
This triangle corresponds to the first example case:
| Name |
|---|


