Hi,

Here is the formula I use for distance measurement in www.geoloc.org

(see measure tool in toolbar):

distance =

Math.round(EarthRadius*Math.acos(Math.cos(lat1)*Math.cos(lat2)*Math.cos(

lon2-lon1)+Math.sin(lat1)*Math.sin(lat2)));

EarthRadius is about 6378 km

Please note that latitude and longitude values must first be converted

in radian: lat_in_radian = lat_in_degree*Math.PI/180

Hope that helps

Christophe

-----Original Message-----

From: occs_2002 [mailto:

occs@...]

Sent: jeudi 29 avril 2004 19:38

To:

svg-developers@yahoogroups.com
Subject: [svg-developers] Distance calculation based on longitude and

latitude/svg data

Does anyone have a good tutorial to calculate mileage (radius) from

zip code to zip code based on lat/long calculation? I'm interested

in incorporating these calculations within an SVG map (obviously).

Thanks.

-----

To unsubscribe send a message to:

svg-developers-unsubscribe@yahoogroups.com
-or-

visit

http://groups.yahoo.com/group/svg-developers and click "edit my

membership"

----

Yahoo! Groups Links