Sub topic 15
Polygons in the Coordinate Plane
Assume you know basic arithmetic, square roots, the area of a triangle and rectangle, and how to plot points \((x,y)\). In coordinate geometry, the coordinates give exact information about a figure. Do not rely on how the figure appears in a diagram.
Finding Side Lengths
The horizontal change between two points is the difference of their \(x\)-coordinates. The vertical change is the difference of their \(y\)-coordinates. For points \((x1,y1)\) and \((x2,y2)\), the distance formula is
\[ d=\sqrt{(x2-x1)^2+(y2-y1)^2}. \]
This formula comes from the Pythagorean theorem. The two coordinate differences form the legs of a right triangle, and the segment between the points is its hypotenuse.
For example, the distance from \((1,2)\) to \((5,5)\) is
\[ \sqrt{(5-1)^2+(5-2)^2} =\sqrt{4^2+3^2} =5. \]
If two points share an \(x\)-coordinate, the segment is vertical, so its length is the absolute difference of the \(y\)-coordinates. If they share a \(y\)-coordinate, use the absolute difference of the \(x\)-coordinates.
Finding Polygon Area
For simple figures, use familiar formulas:
- Rectangle: \(A=lw\)
- Triangle: \(A=\frac12 bh\)
- Parallelogram: \(A=bh\)
- Trapezoid: \(A=\frac12(b1+b2)h\)
For a polygon whose vertices are listed in order, the shoelace formula is often efficient:
\[ A=\frac12\left| \sum xi y{i+1}-\sum yi x{i+1} \right|. \]
Repeat the first vertex at the end of the list. Then multiply each \(x\)-coordinate by the next \(y\)-coordinate and each \(y\)-coordinate by the next \(x\)-coordinate.
| Vertex | \(x_i y_{i+1}\) | \(y_i x_{i+1}\) |
|---|---|---|
| \((0,0)\) to \((4,0)\) | \(0\) | \(0\) |
| \((4,0)\) to \((4,3)\) | \(12\) | \(0\) |
| \((4,3)\) to \((0,3)\) | \(12\) | \(0\) |
| \((0,3)\) to \((0,0)\) | \(0\) | \(0\) |
The difference between the column sums is \(24\), so the area is \(24/2=12\).
def polygon_area(vertices):
total = 0
for i, (x1, y1) in enumerate(vertices):
x2, y2 = vertices[(i + 1) % len(vertices)]
total += x1 * y2 - y1 * x2
return abs(total) / 2
print(polygon_area([(0, 0), (4, 0), (4, 3), (0, 3)]))GRE Checks
Use coordinates to test, rather than assume, geometric properties:
- Equal side lengths can indicate a rhombus.
- Equal diagonals can indicate a rectangle.
- Slopes can test whether lines are parallel or perpendicular.
- A zero horizontal or vertical change identifies an axis-parallel side.
For a line segment, slope is
\[ m=\frac{y2-y1}{x2-x1}. \]
Parallel nonvertical lines have equal slopes. Perpendicular lines have slopes whose product is \(-1\), when both slopes are defined.
Exercise
Find the area of the polygon with vertices \((0,0)\), \((6,0)\), \((6,4)\), and \((2,4)\), listed in order.
Show answer
Use the shoelace formula or view the figure as a \(6\) by \(4\) rectangle minus a \(2\) by \(4\) rectangle. The area is \(24-8=16\).