Hi All,

I am using the following formula to increase the latitude and
longitude to a given miles range in my java code:

Here we assume the range as 25 miles. My input lat and long values
are:
latValue:   44.2249907
lngValue:  -87.7990799

double latRange = (range / 69.172);
double longRange = Math.abs(range/ (Math.cos(lngValue) * 69.172));

after this calculation I am adding/subtracting results miles ranges
(latRange /longRange) from the input latValue and lngValue like the
following:

lat1 = latValue - latRange
lat2 = latValue + latRange
lng1 = lngValue - longRange
lng2 = lngValue + longRange

My problem is after this addition/subtraction, if I calculate the
distance between my input lat and long and the final lat and longs
(lat1,lat2..) it is around 30 miles or greater than 25 miles.

Please let me know if there is any problem with the formula. Or my
approach.
Any help would be grateful.


Thanks,
Venkat





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