On Dec 11, 4:08 pm, yolf <[EMAIL PROTECTED]> wrote:
>         $line = floatval(substr(111.2*acos(sin($lat1) * sin($lat2) + cos
> ($lat1) * cos($lat2) * cos($lon2-$lon1)),0,10));

A couple of things come to mind:
- you need to ensure that you're using radians for cos and sin to work
correctly (you may be, the code snippet doesn't make it clear)
- where does 111.2 come from?

You may want to use the haversine formula on each line segment. It's
given at http://www.movable-type.co.uk/scripts/latlong.html among
other places.

Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to