Why does the matrix area formula for a triangle work?
Here’s the formula (referring to the verticies of a triangle in a coordinate plane):
+/- 0.5 times the determinant of:
[X1 Y1 1]
[X2 Y2 1]
[X3 Y3 1]
why does it work?
It stems from the property that the area of a parallelogram with two vectors as adjacent sides is equal to the determinant of a matrix with those vectors as rows. For instance, suppose you have a parallelogram with one edge <1,1> and the adjacent edge <0,1>. If you form the matrix ‘A’
[ 1 1]
[ 0 1]
and compute the determinant, you get det(A) = 1, which is the area of the parallelogram. If now you only want the area of the triangle with sides <1,1> and <0,1>, you divide by 2. Or 1/2*det(A) = area of triangle.
IF you now draw any triangle with three vertices, and draw vectors from the origin to each vertex, you’ll see that each pair of vectors forms a triangle. Summing the area of these individual triangles (and recognizing that the order of one pair might make "negative area") gives the area enclosed by the three vertices, when divided by 2.
The matrix you show is a simple way to combine the three separate determinants into one.
It stems from the property that the area of a parallelogram with two vectors as adjacent sides is equal to the determinant of a matrix with those vectors as rows. For instance, suppose you have a parallelogram with one edge <1,1> and the adjacent edge <0,1>. If you form the matrix ‘A’
[ 1 1]
[ 0 1]
and compute the determinant, you get det(A) = 1, which is the area of the parallelogram. If now you only want the area of the triangle with sides <1,1> and <0,1>, you divide by 2. Or 1/2*det(A) = area of triangle.
IF you now draw any triangle with three vertices, and draw vectors from the origin to each vertex, you’ll see that each pair of vectors forms a triangle. Summing the area of these individual triangles (and recognizing that the order of one pair might make "negative area") gives the area enclosed by the three vertices, when divided by 2.
The matrix you show is a simple way to combine the three separate determinants into one.
References :