How can you calculate the area of a polygon given its vertices?

  • MHB
  • Thread starter Chris L T521
  • Start date
In summary, to determine the number of vertices in a polygon, count the number of corners or points on the polygon. To find the length of each side, use the distance formula with the coordinates of the vertices. The formula for calculating the area of a polygon is A = 1/2 * (x1y2 + x2y3 + ... + xn-1yn + xny1 - x2y1 - x3y2 - ... - xn-1y1 - x1yn). The area of a polygon cannot be negative, and for a complex polygon with intersecting sides, divide it into smaller polygons and calculate the areas of each before adding them together.
  • #1
Chris L T521
Gold Member
MHB
915
0
Thanks to those who participated in last week's POTW! Here's this week's problem!

-----

Problem: Let $(x_1,y_1),(x_2,y_2),\ldots,(x_n,y_n)$ be points in $\mathbb{R}^2$ such that when they are joined together in succession by line segments [and $(x_n,y_n)$ is joined to $(x_1,y_1)$], the segments enclose a polygonal region $R$ (see attached picture).


Assuming that the polygonal boundary is counterclockwise oriented, prove that the area of the region $R$ is given in terms of the coordinates of its vertices as follows:

\[A(R)=\frac{1}{2}\left(\begin{vmatrix}x_1 & x_2\\ y_1 & y_2\end{vmatrix}+\begin{vmatrix}x_2 & x_3\\ y_2 & y_3\end{vmatrix}+\cdots+\begin{vmatrix}x_{n-1} & x_n\\ y_{n-1} & y_n\end{vmatrix}+\begin{vmatrix}x_n & x_1\\ y_n & y_1\end{vmatrix}\right)\]

-----

Hint:
Use Green's Theorem.

 

Attachments

  • polygonalregion.png
    polygonalregion.png
    4.1 KB · Views: 63
Last edited:
Physics news on Phys.org
  • #2
P.S: For you curious ones out there, here's the TeX code I used to make that image. [I originally was going to put this in the original question post, but it exceeded the character limit... >_>]

Code:
\begin{figure}
   \centering
   \begin{tikzpicture}[domain=-6:6]
      \draw[->] (-3,-1) -- (-3,5) node[above]{$y$};
      \draw[->] (-4,0) -- (5.5,0) node[right]{$x$};
      \fill[color=blue,opacity=.4] (2,.5) -- (3.5,1.5) -- (4,3) -- (2.5,4) -- (0,4) -- (-1.5,2.5) -- (-1, 1.5) -- (0,2) -- (1.5,1.5);
      \draw[color=blue, thick] (2,.5) -- (3.5,1.5) -- (4,3) -- (2.5,4) -- (0,4) -- (-1.5,2.5) -- (-1, 1.5) -- (0,2) -- (1.5,1.5) -- (2,.5);
      \fill[color=blue] (2,.5) circle (2pt);
      \fill[color=blue] (3.5,1.5) circle (2pt);
      \fill[color=blue] (4,3) circle (2pt);
      \fill[color=blue] (2.5,4) circle (2pt);
      \fill[color=blue] (0,4) circle (2pt);
      \fill[color=blue] (-1.5,2.5) circle (2pt) node[right]{$\color{black}(x_n,y_n)$};
      \fill[color=blue] (-1, 1.5) circle (2pt) node[below]{$\color{black}(x_1,y_1)$};
      \fill[color=blue] (0,2) circle (2pt)  node[above=.25cm,right]{$\color{black}(x_2,y_2)$};
      \fill[color=blue] (1.5,1.5) circle (2pt) node[right]{$\color{black}(x_3,y_3)$};
      \draw[color=blue,thick,->] (2,.5) -- (2.75,1);
      \draw[color=blue,thick,->] (3.5,1.5) -- (3.75,2.25);
      \draw[color=blue,thick,->] (4,3) -- (3.25,3.5);
      \draw[color=blue,thick,->] (2.5,4) -- (1.25,4);
      \draw[color=blue,thick,->] (0,4) -- (-.75,3.25);
      \draw[color=blue,thick,->] (-1.5,2.5) -- (-1.25,2);
      \draw[color=blue,thick,->] (-1,1.5) -- (-.5,1.75);
      \draw[color=blue,thick,->] (0,2) -- (.75,1.75);
      \draw[color=blue,thick,->] (1.5,1.5) -- (1.75,1);
   \end{tikzpicture}
   
\end{figure}

To get it to compile, you'll need the tikz package!)
 
  • #3
This week's question was correctly answered by MarkFL and Sudharaka.

Here's MarkFL's solution:

Using Green's theorem, we may state:

$\displaystyle A(R)=\int_{R}\langle 0,x \rangle\cdot dr=\int_{R}\langle -y,0 \rangle\cdot dr$

Let $\displaystyle R_k$ be an arbitrary side of $\displaystyle R$, which we may parametrize as follows:

$\displaystyle r_k(t)=\langle x_k+t(x_{k+1}-x_k),y_k+t(y_{k+1}-y_k) \rangle$ where $\displaystyle 0\le t\le1$

where $\displaystyle 1\le k\le n$ and $\displaystyle (x_{n+1},y_{n+1})=(x_1,y_1)$.

Using the two integrals above, we may state:

(1) $\displaystyle A(R)=\int_{R}\langle 0,x \rangle\cdot dr=\sum_{k=1}^n\left(\int_{R_k}\langle 0,x \rangle\cdot dr \right)$

(2) $\displaystyle A(R)=\int_{R}\langle -y,0 \rangle\cdot dr=\sum_{k=1}^n\left(\int_{R_k}\langle -y,0 \rangle\cdot dr \right)$

Using:

$\displaystyle r_k'(t)=\langle x_{k+1}-x_k,y_{k+1}-y_k \rangle$

we now have:

$\displaystyle \int_{R_k}\langle 0,x \rangle\cdot dr=\int_0^1 \langle 0,x_k+t(x_{k+1}-x_k) \rangle\cdot\langle x_{k+1}-x_k,y_{k+1}-y_k \rangle\,dt$

$\displaystyle \int_{R_k}\langle 0,x \rangle\cdot dr=(y_{k+1}-y_k)\int_0^1 x_k+t(x_{k+1}-x_k)\,dt$

$\displaystyle \int_{R_k}\langle 0,x \rangle\cdot dr=(y_{k+1}-y_k)\left[x_kt+(x_{k+1}-x_k)\frac{t^2}{2} \right]_0^1$

$\displaystyle \int_{R_k}\langle 0,x \rangle\cdot dr=(y_{k+1}-y_k)\left(x_k+\frac{1}{2}(x_{k+1}-x_k) \right)$

$\displaystyle \int_{R_k}\langle 0,x \rangle\cdot dr=\frac{1}{2}(y_{k+1}-y_k)(x_k+x_{k+1})$

Using our summation formula (1), we find:

$\displaystyle A(R)=\sum_{k=1}^n\left(\frac{1}{2}(y_{k+1}-y_k)(x_k+x_{k+1}) \right)$

Using the second integral, we have:

$\displaystyle \int_{R_k}\langle -y,0 \rangle\cdot dr=\int_0^1 \langle -(y_k+t(y_{k+1}-y_k)),0 \rangle\cdot\langle x_{k+1}-x_k,y_{k+1}-y_k \rangle\,dt$

$\displaystyle \int_{R_k}\langle -y,0 \rangle\cdot dr=(x_{k+1}-x_k)\int_0^1 -(y_k+t(y_{k+1}-y_k)\,dt$

$\displaystyle \int_{R_k}\langle -y,0 \rangle\cdot dr=-(x_{k+1}-x_k)\left[y_kt+(y_{k+1}-y_k)\frac{t^2}{2} \right]_0^1$

$\displaystyle \int_{R_k}\langle -y,0 \rangle\cdot dr=-(x_{k+1}-x_k)\left(y_k+\frac{1}{2}(y_{k+1}-y_k) \right)$

$\displaystyle \int_{R_k}\langle -y,0 \rangle\cdot dr=\frac{1}{2}(x_k-x_{k+1})(y_k+y_{k+1})$

Using our summation formula (2), we find:

$\displaystyle A(R)=\sum_{k=1}^n\left(\frac{1}{2}(x_k-x_{k+1})(y_k+y_{k+1}) \right)$

Adding the two summations, there results:

$\displaystyle 2A(R)=\sum_{k=1}^n\left(\frac{1}{2}(y_{k+1}-y_k)(x_k+x_{k+1}) \right)+\sum_{k=1}^n\left(\frac{1}{2}(x_k-x_{k+1})(y_k+y_{k+1}) \right)$

$\displaystyle 4A(R)=\sum_{k=1}^n\left((y_{k+1}-y_k)(x_k+x_{k+1})+(x_k-x_{k+1})(y_k+y_{k+1}) \right)$

$\displaystyle 4A(R)=2\sum_{k=1}^n\left(x_ky_{k+1}-x_{k+1}y_k \right)$

$\displaystyle 2A(R)=\sum_{k=1}^n\left(\begin{vmatrix}x_k & x_{k+1}\\ y_k & y_{k+1}\end{vmatrix} \right)$

Hence:

$\displaystyle A(R)=\frac{1}{2}\left(\begin{vmatrix}x_1 & x_2\\ y_1 & y_2\end{vmatrix}+\begin{vmatrix}x_2 & x_3\\ y_2 & y_3\end{vmatrix}+\cdots+\begin{vmatrix}x_{n-1} & x_n\\ y_{n-1} & y_n\end{vmatrix}+\begin{vmatrix}x_n & x_1\\ y_n & y_1\end{vmatrix}\right)$

Shown as desired.

Here's Sudharaka's solution:

Using the Green's theorem with \(M=\dfrac{x}{2}\) and \(L=-\dfrac{y}{2}\) we get,

\[A=\iint_{R}\mathrm{d}x\, \mathrm{d}y=\frac{1}{2}\oint_{C} (-y\, \mathrm{d}x + x\, \mathrm{d}y)\]

where \(C\) is the boundary of the region \(R\).

\[\therefore A=\frac{1}{2}\sum_{k=1}^{n}\int_{A_1}^{A_2}(-y\, \mathrm{d}x + x\, \mathrm{d}y)\]

where \(A_{1}=(x_{k},\, y_{k})\) and \(A_2=(x_{k+1},\, y_{k+1})\) with \((x_{n+1},\,y_{n+1})=(x_{1},\,y_{1})\).

The equation of the line joining the points, \(A_1\) and \(A_2\) is,

\[y=y_{k+1}+\left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)(x-x_{k+1})\]

\[\therefore dy=\left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)dx\]

Hence we get,

\begin{eqnarray}

A&=&\frac{1}{2}\sum_{k=1}^{n}\int_{A_1}^{A_2} \left[-y_{k+1}-\left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)(x-x_{k+1})+x \left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)\right]\, dx\\

&=&\frac{1}{2}\sum_{k=1}^{n}\int_{A_1}^{A_2} \left[-y_{k+1}+\left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)x_{k+1}\right]\, dx\\

&=&\frac{1}{2}\sum_{k=1}^{n}\left\{\left[-y_{k+1}+\left(\frac{y_{k+1}-y_{k}}{x_{k+1}-x_{k}}\right)x_{k+1}\right](x_{k+1}-x_{k})\right\}\\

&=&\frac{1}{2}\sum_{k=1}^{n}(y_{k+1}x_k-y_{k}x_{k+1})\\

&=&\frac{1}{2}\sum_{k=1}^{n}\begin{vmatrix}x_{k} & x_{k+1}\\ y_{k} & y_{k+1}\end{vmatrix}\\

&=&\frac{1}{2}\left(\begin{vmatrix}x_1 & x_2\\ y_1 & y_2\end{vmatrix}+\begin{vmatrix}x_2 & x_3\\ y_2 & y_3\end{vmatrix}+\cdots+\begin{vmatrix}x_{n-1} & x_n\\ y_{n-1} & y_n\end{vmatrix}+\begin{vmatrix}x_n & x_1\\ y_n & y_1\end{vmatrix}\right)

\end{eqnarray}
 

Related to How can you calculate the area of a polygon given its vertices?

1. How do you determine the number of vertices in a polygon?

The number of vertices in a polygon is equal to the number of corners or points where the sides of the polygon meet. To determine the number of vertices, count the number of corners or points on the polygon.

2. How do you find the length of each side of a polygon given its vertices?

To find the length of each side of a polygon, you can use the distance formula. This formula uses the coordinates of the two points on the side to calculate the distance between them. Repeat this process for each side to find the length of all sides of the polygon.

3. What is the formula for calculating the area of a polygon?

The formula for calculating the area of a polygon is A = 1/2 * (x1y2 + x2y3 + ... + xn-1yn + xny1 - x2y1 - x3y2 - ... - xn-1y1 - x1yn), where (x1, y1), (x2, y2), ..., (xn, yn) are the coordinates of the vertices of the polygon in order.

4. Can the area of a polygon be negative?

No, the area of a polygon cannot be negative. It is a measure of the space enclosed by the polygon and therefore, it is always a positive value.

5. How do you calculate the area of a complex polygon with intersecting sides?

To calculate the area of a complex polygon with intersecting sides, you can divide the polygon into smaller, non-intersecting polygons and calculate the area of each of them using the formula mentioned in question 3. Then, add the areas of all the smaller polygons together to get the total area of the complex polygon.

Similar threads

Replies
3
Views
862
  • Math POTW for Secondary and High School Students
Replies
1
Views
864
  • Linear and Abstract Algebra
Replies
14
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
Replies
3
Views
1K
Replies
18
Views
2K
  • Linear and Abstract Algebra
Replies
5
Views
2K
Replies
24
Views
2K
Back
Top