Is there any algorithm for calculating area of a shape given co-ordinates that define the shape?
So I have some function that receives N random `2D` points.
Is there any algorithm to calculate area of the shape defined by the input points?
Ben L.
answered 03/21/25
Full Stack Prin Software Engineer
There are lots of formulas for different specific n-gons. The way you've phrased the question is pretty general.
https://www.geeksforgeeks.org/area-of-2d-shapes/
Ordered Sequence:
- Take a look at the Shoelace algorithm (Gauss Area Formula).
Unordered Sequence:
- Find the convex hull.
- Apply the shoelace algorithm.
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.