Question

So I'm working on a piece of code to take positional data for a RC Plane Crop Duster and compute the total surface area transversed (without double counting any area). I cannot figure out how to calculate the area for a given period of operation.

Given the following Table Calculate the area the points cover.

x,y
1,2
1,5
4,3
6,6
3,4
3,1

Any Ideas? I've browsed Greens Theorem and I'm left without a practical concept in which to code.

Thanks for any advise

Was it helpful?

Solution

  1. Build the convex hull from the given points

    Algorithms are described here

    See a very nice python demo + src

  2. Calculate its area

    Python code is here

OTHER TIPS

Someone mathier than me may have to verify the information here. But it looks legit: http://www.wikihow.com/Calculate-the-Area-of-a-Polygon and fairly easy to apply in code.

I'm not entirely sure that you're looking for "Surface area" as much as you're looking for Distance. It seems like you want to calculate the distance between one point and the next for that list. If that's the case, simply use the Distance Formula.

If the plane drops a constant width of dust while flying between those points, then the area is simply the distance between those points times the width of the spray.

If your points are guaranteed to be on an integer grid - as they are in your example - (and you really are looking for enclosed area) would Pick's Theorem help?

You will have to divide the complex polygon approximately into standard polygons (triangles, rectangles etc) and then find area of all of them. This is just like regular integration (only difference is that you are yet to find a formula to approximate your data).

The above points are when you assume that you are forming a closed polygon with your data.

Use to QHull to triangulate the region, then sum the areas of the resulting triangles.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top