The area of a triangle in the coordinate plane

The area of a triangle with known coordinates can be computed by a formula. Consider the triangle with vertices A(1,1)A(1, 1), B(5,1)B(5, 1), C(2,4)C(2, 4).

When a base and height are easy to read off, you can use them directly. The side ABAB lies on y=1y = 1 with length 51=45 - 1 = 4. The height from CC is its distance from this base, the difference between CC's yy-coordinate 44 and the base's y=1y = 1, namely 41=34 - 1 = 3. So the area is 12×4×3=6\dfrac{1}{2} \times 4 \times 3 = 6.

For a general triangle whose base is not parallel to an axis, use this formula. The area of the triangle A(x1,y1)A(x_1, y_1), B(x2,y2)B(x_2, y_2), C(x3,y3)C(x_3, y_3) is

12x1(y2y3)+x2(y3y1)+x3(y1y2)\dfrac{1}{2} \left| x_1(y_2 - y_3) + x_2(y_3 - y_1) + x_3(y_1 - y_2) \right|

Substituting gives 121(14)+5(41)+2(11)=123+15+0=12×12=6\dfrac{1}{2}|1(1 - 4) + 5(4 - 1) + 2(1 - 1)| = \dfrac{1}{2}|-3 + 15 + 0| = \dfrac{1}{2} \times 12 = 6, matching the value above. The absolute value keeps the area positive, and the result is the same in whatever order the vertices are listed. The three lines on the graph are the sides ABAB, BCBC, CACA, and the large dots are the vertices A(1,1)A(1, 1), B(5,1)B(5, 1), C(2,4)C(2, 4).