Using the determinant of a matrix to calculate the area of a polygon
The signed area of a polygon is given by
| A = (1/2) |
ê ê ê ê ê ê ê ê ê ê ê |
| x1 |
y1 |
| x2 |
y2 |
.
.
. |
.
.
. |
xn |
yn |
|
ê ê ê ê ê ê ê ê ê ê ê |
= (1/2) (
x1y2 + x2y3 + ... + xny1
- x2y1 - x3y2 - ... - x1yn
)
) |
The proof of this can be obtained by induction. We know
the formula is true for a triangle (n=3). Let's assume it's true for any
n, and show it's true for n+1.
Here is our polygon
with n points, labeled counterclockwise, P1, P2,
..., Pn.
Its area is given by the formula above, An = 1/2(
x1y2 + x2y3 + ... + xny1
- x2y1 - x3y2 - ... - x1yn
)
Remember, this is the "signed area", which is positive if the
vertices are given in counterclockwise order. When we add the n+1st
point, we will change the area of the polygon, and the amount (and sign)
of the change is exactly the area of the newly formed triangle |
Pn(xn,yn)
Pn+1(xn+1,yn+1)
P1(x1,y1)
The area of the yellow triangle, At, is
given by the same formula: At = 1/2(xnyn+1 + xn+1y1 + x1yn
- xn+1yn - x1yn+1 - xny1) Here is
the new polygon
with n+1 points, labeled counterclockwise, P1, P2,
..., Pn, Pn+1. Its area, An+1, is the sum of the areas of
the original n-gon, An, and the new triangle, At. An+1
= An + At An+1 = 1/2(
x1y2 + x2y3 + ... + xny1
- x2y1 - x3y2 - ... - x1yn
+ xnyn+1 + xn+1y1 + x1yn
- xn+1yn - x1yn+1 - xny1
)
|
An+1 = 1/2 (x1y2 + x2y3 + ... + xnyn+1
+ xn+1y1
- x2y1 - x3y2 - ... - xn+1yn - x1yn+1), which
proves, by induction, that the formula is right. What if the new point is inside
the original polygon, you might ask. In that case, the new triangle, Pn,
Pn+1, P1, has its vertices named in clockwise order, not counterclockwise.
So the area of the new triangle, as calculated by the formula, is
negative. The algebraic addition of the area of the triangle to the area
of the original n-gon results in the new, smaller, area of the n+1-gon.
Related Pages in this website
Triangle Area using Determinant
Triangle Area using Vectors
Introduction to Matrices
Matrix Definitions
Cramer's Rule
Points and Triangles -- answers
the question: is the point inside the triangle?
Points and Lines -- answers
questions like finding the equation of a line given a point and a slope, or
another point
Heron's formula for the
area of a triangle, if all you know is the lengths of its sides.
|