On Jan 7, 11:42 am, "warden [Andrew Leach - Maps API Guru]"
<[email protected]> wrote:
> > And finally, the cleaned up examples from my last post avoided all the
> > problems *and* demonstrated the error in the formula.
>
> Admittedly it could have been clearer that it's an approximation which
> relies on a negligible difference between spherical and plane
> geometry.
>
> It breaks down in boundary cases, but in the context in which it was
> offered that wasn't relevant, and for most purposes it's fine.
Certainly for most purposes, away from the poles, its good. But its
not clear that the errors are irrelevant in the context in which it
was offered, since we dont know the required accuracy.
The link I provided earlier (http://www.itu.int/ITU-R/index.asp?
category=information&rlink=faq&faq=broadcasting&ID=ALL&lang=en) also
specifies how *they* compute the c of g.
1. The (lon, lat) coordinates of the transmitters are converted into
Cartesian coordinates (x, y, z).
2. The mean of each of the Cartesian coordinates is determined.
3. The resulting centre of gravity lies inside the sphere, and needs
to be brought back to the surface of the sphere by normalization along
the radial.
4. The final result is obtained by reverting back to (lon, lat)
coordinates.
Clearly, they wouldnt go to all that trouble if it made no
difference...
> Can you provide a general formula?
I had to think about the above method for a while. My initial reaction
was that it was an approximation - although its clearly good as long
as the points aren't too far apart (say < 1000 miles).
But thinking about it some more, its exact for the case of 2 points
(the reprojection of the midpoint bisects the great circle path
between the points).
Also, if you take the (spherical) triangle defined by the midpoints of
the three sides of the original, that new triangle's CofG coincides
with the original's.
So you could create a series of ever-smaller triangles, forming the
vertices of each new triangle from the midpoints of the edges of the
previous. In the limit, all the vertices will approach the CoG of the
first triangle.
But the CofG as computed by the above is the same for every one of
those triangles - so I believe the above *is* exact (feel free to
point out the flaw in my reasoning!).
So how to do it?
Well, the easy way would be to use
http://earth-api-samples.googlecode.com/svn/trunk/lib/math32.js
to do the lat/lon to and from cartesian conversions :-)
Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---