# document.write (document.title)

 Math Help > Geometry > Polygons and Triangles > Area > Vector Area > Determinant Area

# Using the determinant of a matrix to calculate the area of a triangle

 On 10/24/01 11:56:21 PM, Wert Shin wrote: >The Cramer's Rule for area of >a triangle is
>
>
>
>
>
>
>
A = (1/2)

ê
ê
ê
ê
ê
ê
ê

 x1 y1 1 x2 y2 1 x3 y3 1

ê
ê
ê
ê
ê
ê
ê

 >but how does it work?

This formula gives the area of the triangle formed by the vertices

(x1,y1), (x2,y2), and (x3,y3)

The determinant of this matrix is

D = x1y2 + x2y3 + x3y1 - x1y3 - x2y1 - x3y2

This can be partially factored as

D = (x1-x3)(y2-y3) - (x2-x3)(y1-y3)

Now move the vertex (x3,y3) to the origin by subtracting it from each of the vertices.  So now our triangle becomes

(x1-x3,y1-y3), (x2-x3,y2-y3), and (0,0)

Naturally, this triangle has the same area as the original triangle; All I've done is move it.  To simplify the discussion, let

a = (x1-x3),
b = (y1-y3),
c = (x2-x3), and
d = (y2-y3)

Now the triangle in question has vertices (a,b), (c,d), and (0,0).  Substituting these variables into the equation, above, for the determinant of the original matrix, we see it is

The area of the triangle, then, using the determinant formula is

Well, not quite.  The area can't be negative, so we have to take the absolute value.

Let's review.  Here is what we know so far

(1) The determinant of the 3x3 matrix, above, is equal to ad-bc, after we set a, b, c, and d appropriately.

(2) The area of triangle (a,b), (c,d), (0,0) is the same as the area of triangle
(x1,y1), (x2,y2), and (x3,y3)

Now, to finish the explanation of why half the determinant of that 3x3 matrix is equal to the triangle's area, we just need to explain why

### Related Pages in this website

Polygon Area using Determinant

Introduction to Matrices

Matrix Definitions

Cramer's Rule

Heron's formula for the area of a triangle, if all you know is the lengths of its sides.

Algorithm to determine whether a point is inside a triangle.

The webmaster and author of this Math Help site is Graeme McRae.