The area of a triangle in the coordinate plane

The area of a triangle whose coordinates are known can be found by formula. Take the triangle with vertices A(1,1)A(1, 1), B(5,1)B(5, 1) and C(2,4)C(2, 4).

From a base and a height

When a base and a height can be read off directly, that is enough. The side ABAB lies on y=1y = 1 and has length 51=45 - 1 = 4. The height of the vertex CC is its distance from that base, the difference between the yy-coordinate 44 of CC and the line y=1y = 1, so 33. The area is therefore 12×4×3=6\dfrac{1}{2} \times 4 \times 3 = 6.

The formula from coordinates

When the base is not parallel to an axis, the following formula applies. For A(x1,y1)A(x_1, y_1), B(x2,y2)B(x_2, y_2) and C(x3,y3)C(x_3, y_3) the area is as follows.

S=12x1(y2y3)+x2(y3y1)+x3(y1y2)S = \frac{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=6\dfrac{1}{2}|1(1 - 4) + 5(4 - 1) + 2(1 - 1)| = \dfrac{1}{2}|{-3} + 15 + 0| = 6, agreeing with the answer above.

Moving a vertex to the origin

The formula becomes clearer once the vertex AA is moved to the origin. Translating AA there carries BB to (4,0)(4, 0) and CC to (1,3)(1, 3). The area of the triangle formed by the origin and two points (p,q)(p, q) and (r,s)(r, s) takes the following form.

S=12psqrS = \frac{1}{2}|ps - qr|

Substituting gives 124301=6\dfrac{1}{2}|4 \cdot 3 - 0 \cdot 1| = 6. A translation does not change an area, so this is all that is needed. The quantity psqr|ps - qr| is the area of the parallelogram spanned by the two vectors, and the triangle is exactly half of it.

MethodComputationResult
Base and height12×4×3\dfrac{1}{2} \times 4 \times 366
The coordinate formula123+15+0\dfrac{1}{2}|{-3} + 15 + 0|66
Moving to the origin124301\dfrac{1}{2}|4 \cdot 3 - 0 \cdot 1|66

What the absolute value is for

The absolute value is there to make the area positive, so that the answer does not depend on the order of the vertices. The sign of the value without it records the direction in which ABCA \to B \to C is traced.

  • Counterclockwise gives a positive value
  • Clockwise gives a negative value
  • Three points on one line give 00

The area is 00 exactly when the triangle collapses, so the formula also serves as a test of whether three points are collinear.

Extending to a polygon

The same idea extends to a polygon, tracing the vertices in order, and becomes the shoelace formula1. A triangle is its simplest case.

The three lines on the graph are the three sides, and the large dots are the vertices AA, BB and CC.

  1. Shoelace formula, Wikipedia