I need some math help. I need to make a BR program figure out the distance between two zip codes using longitude and latitude.
Using these two zips
Zip code 61360 is Seneca Illinois, Lat is 41.311N Long is -88.609W
Zip Code 60541 is Newark Illinois, Lat is 41.537N Long is -88.583W
Anyone know how to do the math to tell me the distance in miles between these two zip codes???
Kurt
Distance between two zips using Longitude/latitude
Moderators: Susan Smith, admin, Gabriel
this might help:
wolframalpha can be used to determine all kinds of mathmatecial calculations
passing:
41.311deg N, 88.609deg E, 41.537deg N, 88.583deg E
to wolframalpha returns:
http://www89.wolframalpha.com/input/?i= ... 8.583deg+E
you could probably use cURL or new HTTP features to access this web site programmaticly or something.
wolframalpha can be used to determine all kinds of mathmatecial calculations
passing:
41.311deg N, 88.609deg E, 41.537deg N, 88.583deg E
to wolframalpha returns:
http://www89.wolframalpha.com/input/?i= ... 8.583deg+E
you could probably use cURL or new HTTP features to access this web site programmaticly or something.
Hi John,
Thats pretty cool, but I need to know the formula to calculate that. I need to develop a program that allows a user to enter two zip codes which I then use to look up the longitude and latitude values in a file.
Then I need to calculate the distance in miles between those two and show the user.]
I'm on BR 3.93 or something like that.....yeah I know, really old.
I need BR code to do this, and I'm no math wiz.
Kurt
Thats pretty cool, but I need to know the formula to calculate that. I need to develop a program that allows a user to enter two zip codes which I then use to look up the longitude and latitude values in a file.
Then I need to calculate the distance in miles between those two and show the user.]
I'm on BR 3.93 or something like that.....yeah I know, really old.
I need BR code to do this, and I'm no math wiz.
Kurt
Zip1$, LAT1 & LONG1 are required
Zip2$, LAT2 & LONG2 are required
I am not exactly sure about the "N" & "W", but Both LAT & LONG need to be (+) Values IE:
"61360" LAT =41.3267 LONG =88.6042
"60541" LAT =41.5266 LONG = 88.5274
100 LET CNV1=180/PI
110 LET A=SIN(LAT1/CNV1)*SIN(LAT2/CNV1)+COS(LAT1/CNV1)*COS(LAT2/CNV1)*COS(LONG2/CNV1-LONG1/CNV1)
120 LET DIST=3959*ATN(SQR(ROUND((1-A**2),10))/A)
Ever wondered when you would use your math from high school in real life?
The distance between "61360","60541" = 7.302294 miles
Zip2$, LAT2 & LONG2 are required
I am not exactly sure about the "N" & "W", but Both LAT & LONG need to be (+) Values IE:
"61360" LAT =41.3267 LONG =88.6042
"60541" LAT =41.5266 LONG = 88.5274
100 LET CNV1=180/PI
110 LET A=SIN(LAT1/CNV1)*SIN(LAT2/CNV1)+COS(LAT1/CNV1)*COS(LAT2/CNV1)*COS(LONG2/CNV1-LONG1/CNV1)
120 LET DIST=3959*ATN(SQR(ROUND((1-A**2),10))/A)
Ever wondered when you would use your math from high school in real life?
The distance between "61360","60541" = 7.302294 miles