I have two arrays https://i.stack.imgur.com/2EyfL.png, first one is y coordinates and the second one is x coordinates, when I plot a diagram with these coordinates, it becomes a closed shape like the attached image https://i.stack.imgur.com/rOQ7A.png, I'm asking for a way to calculate the inside area of this closed shape in python.
Asked
Active
Viewed 241 times
2 Answers
0
How to calculate area of an organic shape?
Check out this link, I think it has the same question as you.
Even though it uses another language, you can try and convert it to Python code.

PythonPikachu8
- 359
- 2
- 11
-
Thank you very much, that was very helpful – Amir Shahmohamadi Apr 03 '21 at 05:10
-
Yup! No problem. – PythonPikachu8 Apr 03 '21 at 16:18
0
Check out the code here: Calculate area of polygon given (x,y) coordinates
def PolyArea(x,y):
return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1)))

Iñigo Moreno
- 529
- 2
- 15