Question: Create a program that can calculate the area of any polygon by following below, To calculate the area, you must first be able to calculate
Create a program that can calculate the area of any polygon by following below,


To calculate the area, you must first be able to calculate the cross product of two points. Given P1 = (X1, y) and p2 = (X2,Y2), the cross product is p1 p2 = 1Y2-X2y1. Now, suppose you have a polygon whose vertices are p1, p2, , pn), where the vertices are listed consecutively as you travel counterclockwise around the polygon. Then, the area of the i=1 where pn+1 = p1 An easy way to perform the calculation is to keep track of three points: the first point in the list, the current / most recently input point, and the previous point. Read the first point and also make that the current point. Then, perform a do loop. Inside, do the following
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
