I am measuring a feature that is somewhat round but has lot of jagged edges. I want to use all of the areas to calculate the area. I am measuring this using hundreds of points. Anyone have any ideas ? I have searched for answers but can't seem to come up with any.
The only thing that I can think of that will scale up in accuracy in proportion to the number of points you are taking is to break the shape down into a set of radial triangles (like a pie):
- Construct a best-fit circle to establish a center point.
- Calculate the area of a triangle by three points. a= abs((Ax(By-Cy)+Bx(Cy-Ay)+Cx(Ay-By))/2)
* Use the center point from the best fit circle as point and two consecutive perimeter points as the other two.
- Add this area value to a variable.
- Calculate the next triangle by keeping the centerpoint and one of the perimeter points the same and rotating around to the next consecutive point. This way each new triangle shares one side of the previous triangle.
- After each area calculation add the value into your collection variable.
After you get all the way around and your last triangle has a second point equal to the first point of your first triangle then you stop the loop.
The short side of each triangle is a chord of the radius in that area so you will be chopping off a small part of the radius and not including (or including depending on internal or external radius) it in the calculation. The accuracy will scale linearly with the number of points taken.