Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to find the area of a polygon using c#

The polygon consists of 3 axes x,y z.

How to do this calculation using C#
Posted
Comments
lukeer 26-Mar-14 5:10am    
I doubt that the polygon consists of 3 axes x, y and z.

1) It may exist in a Euclidean space defined by the axes x, y and z. But given that, we don't know anything, because it's the standard definition.

2) Or you have a polygon consisting of 3 sides which are named x, y and z. That's a very unusual naming given (1).

3) So presumably you have a polygon in 3D space consisting of 3D points. Do you know if these points are all in one plane? If so, transform all points to be in x-y plane and process area.
If not, things are getting vague. You could split the polygon into distinct triangles whose planes are known, calculate their areas as mentioned above and sum over them.
Or you construct a Minimal Surface[^] over the given points, in which case I'm not able to help.

1 solution

Use RenderedGeometry property of Polygon which returns a Geometry object. This Geometry object has a method called GetArea() which returns the area of the polygon.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900