A polygon is a plane figure that is described by a finite number of straight line segments connected to form a closed polygonal chain or polygonal circuit.
I designed this program to help OOP (Object Oriented Programming) students. However, this application can be used for any subject relating to polygons. The sole purpose of this application is to help students process the understanding of polygon. This program was not designed to help students breach academic integrity.
How to use polygon calculation:
1. Enter the number of vertices (points) of the polygon.
2. Enter the Cartesian coordinate points accordingly.
3. The calculated perimeter and area will display.
4. Enter a point to check if that point is inside the polygon shape.
Perimeter:
To calculate the perimeter, I sum all the distance between each point.
Area:
To calculate the area, I sum the average height multiplied by the width between each pair of coordinates.
+ average height calculates by adding y1 + y2 / 2
+ width calculates by x2 – x1
Check if a point is within the polygon:
To check if a point is inside the polygon, I plot the point on the Cartesian plane. Then I draw a straight line across the plane.
+ if the line crosses or intersects with the polygon (even number) of crosses
then the point is outside of the polygon
+ if the line crosses or intersects with the polygon (odd number) of crosses
then the point is inside the polygon
This application designed to help students visualize the polygons mechanism.