A week or more ago, someone posted a formula for calculating the distance
between two points using latitude/longitude. I think the formula as
incorrect. However, here is one that works perfectly;

#Evaluate(((pi()*6378)/180)*(ACos((Sin(lat_A)*Sin(lat_B)) +
(Cos(lat_A)*Cos(lat_B)*Cos(lat_A-lat_B)))))#

This yields distance in KM. If you want miles, do the calculation after the
fact, or change the value of 6378  - the earth's radius in KM - to a value
in miles.

--Dylan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to