Re: polygonal area on a sphere
- From: "Colin Barker" <colin.barker@xxxxxxxxxx>
- Date: Thu, 22 Feb 2007 10:29:17 +0100
<moltilimits@xxxxxxxxx> a écrit dans le message de news:
1172134968.890468.317230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
please, someone can tell me how can I to calculate the area of a
polygon on the earth's surface where I know the coordinates (lat/lon)
of its points?
Since you know the coordinates of every vertex, break it into
triangles. The area of every triangle is that triangle's base
times its height divided by two. Sum the areas.
It's ok like idea, but doesn't exists a formula that uses vertex
coordinates to obtain the result?
Break the area in small trangles is allright, but practically how can
I implement it? I must find a point internal to the polygon and then
consider all the triangles? So, the calculus of the areas isn't very
easy: I know the vertex of the triangle and the calculus of the height
can be difficult.
Must I use the Erone's formula?
Sorry for the questions but I see this problem very difficult for me :-
If you convert your coordinates from latitude/longitude to UTM, and assuming
the points are sufficiently close that they can be considered to be on a
plane, you could calculate the area using the following C code:
/*
* Returns the area of the polygon enclosed by the n points (x[0],y[0])
* to (x[n-1],y[n-1]). The sign of the result is positive if the
* orientation of the polygon is counterclockwise, and negative if it
* is clockwise.
*/
double area(double x[], double y[], unsigned n)
{
unsigned i;
double area;
area = x[n-1]*y[0] - y[n-1]*x[0];
for (i = 0; i < n-1; i++) {
area += x[i]*y[i+1] - y[i]*x[i+1];
}
return area / 2;
}
--
Colin
.
- References:
- polygonal area on a sphere
- From: moltilimits
- Re: polygonal area on a sphere
- From: Sam Wormley
- Re: polygonal area on a sphere
- From: moltilimits
- polygonal area on a sphere
- Prev by Date: Re: polygonal area on a sphere
- Next by Date: Re: Question re fast charging charging Eneloop batteries
- Previous by thread: Re: polygonal area on a sphere
- Next by thread: Re: polygonal area on a sphere
- Index(es):
Relevant Pages
|
|