I just used mapquest.com to get any zip codes I would like to calculate the 
long/lat for. You can get all that info there. Also below is your mystical 
formula ;)

<CFSET City1="Los Angeles">
<CFSET City2="New York City">
<CFSET State1="California">
<CFSET State2="New York">

<CFSET Latitude1="34.0522">
<CFSET Latitude2="40.7142">
<CFSET Longitude1="-118.2428">
<CFSET Longitude2="-74.0064">

<CFSET Temp = sin(Latitude1) * sin(Latitude2 * pi()/180) +
        cos(Latitude1) * cos(Latitude2 * pi()/180) *
        cos(Longitude2 * pi()/180 - Longitude1)>
<CFIF temp IS 1>
        <CFSet Mileage = 0>
<CFElse>
        <CFSET Mileage = 3963.0 * (ATN(-Temp / SQR(-Temp * Temp + 1))
        + 1.570796326794895)>
        <CFSet Mileage = Round(Mileage * 100) / 100>
</CFIF>

<CFOUTPUT>
<b>Temp value:</b> #Temp#<br />
It is <b>#Mileage# miles</b> from <b>#City1#, #State1#</b> to <b>#City2#, 
#State2#</b><br />
</CFOUTPUT>

-----Original Message-----
From: Scott Weikert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 3:30 PM
To: CF-Talk
Subject: Semi-OT - Zip code dbs/dist. formulas?


Hey gang,

I'm wondering if anyone has, or can point me at, a good (i.e. cheap or free)
source for zip code data, along with lat/long values for each, and the
mystical formula for calculating the distance between one lat/long and
another lat/long.

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

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to