Hello,
I wan't to find the center/centroid of a polygon consisting of latitude and longitude coordinates. The calculation has to work all over the globe.
Thanks!
The "centroid" of a triangle is the average of the three vertices but there is no simple formula for a polygon. About the best you can do is divide the polygon into triangles and find the centroid of each triangle but then you have to take the weighted average of all of those weighted by the area of each triangle.
If you are using two latitudes and two longitudes for the boundary of your polygon, then the centroid will fall on the average between the two end longitudes.
However, the centroid latitude will require a few more calculations.
The length of the latitude arc, changes continously with change in
latitude.
Since, the shape of the polgon is not defined, a solution probably would not be the one you seek.