Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you calculate the area of a series of random points?

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

like image 458
TelsaBoil Avatar asked Aug 30 '10 19:08

TelsaBoil


4 Answers

  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

like image 178
Lior Kogan Avatar answered Oct 04 '22 13:10

Lior Kogan


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.

like image 31
Angelo R. Avatar answered Sep 30 '22 13:09

Angelo R.


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.

like image 25
Dave McClelland Avatar answered Oct 04 '22 13:10

Dave McClelland


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?

like image 26
Chowlett Avatar answered Oct 02 '22 13:10

Chowlett