3

I wonder if someone can help me to find the area of a 2-D object in Cartesian plane , when we know coordinates of every points. Eg : I want to calculate the area of a triangular. A(12,34) B(45,89) C(25,35)

I want a common algorithm to find any 2-D object's area.

Thank you.

devan
  • 1,643
  • 8
  • 37
  • 62
  • 1
    What are the constraints? Are the points always ordered around the object boundary? Is the boundary always closed and the object simply connected (no holes)? Is it always convex? – Ted Hopp May 23 '11 at 03:59

2 Answers2

2

Here you go, uses triangulation. This was literally the top result off Google when I searched "area of polygon given set of points". Please do your research before posting.

1

If your object is a simple polygon, there's no need to triangulate it to compute its area. There's a simple formula that depends only on the coordinates of the vertices. See http://en.wikipedia.org/wiki/Polygon#Area_and_centroid

lhf
  • 70,581
  • 9
  • 108
  • 149
  • +1. The area formula may be expressed as a consequence of Green's theorem: http://en.wikipedia.org/wiki/Green%27s_theorem#Area_Calculation – Jason S May 23 '11 at 13:05
  • @Jason, yes, and it's also a consequence of triangulation. – lhf May 23 '11 at 13:24