Suppose I know 700 different values of x as well as another 700 different values of y coordinates. Every 7 points from my coordinates can construct a polygon. I can easily pick any formula (here I have used shoelace formula) to calculate the area of any polygon. But it's really tough to calculate area of each polygon in this way, is there any good way by which I can calculate the area of all polygon (for this case the total number of polygon is 100) at a time, e.g. by using any iteration.
A simple code is shown below:
import numpy as np
x = np.arange(0.5, 700) #create random coordinates
y = np.arange(0.3, 700) #create random coordinates
#first 7 coordinates that could form a polygon
x_1 = x[0:7]
y_1 = y[0:7]
#Area of the first polygon
Area = 0.5 * np.array(np.dot(x_1, np.roll(x_1, 1)) - np.dot(y_1, np.roll(y_1, 1)))