deeptinayak
asked on
How to calculate the latitude from distance
If I have a latitude/longitude value and DISTANCE value, How can I compute the latitude/longitude which is at “DISTANCE” miles from the given latitude/longitude value?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I need to calculate it the other way round.
If the latitude value is 14.52 degrees, I need the latitude delta value within 50 miles of distance.
I know the result would be around ~0.01 degrees
If the latitude value is 14.52 degrees, I need the latitude delta value within 50 miles of distance.
I know the result would be around ~0.01 degrees
As ozo has said, there's an infinite number of possible solutions.
Imagine a point on the Earth. Now draw a circle around this point with a radius of "distance". The corresponding lat/long values that you're looking for could be _anywhere_ on the circumference of that circle.
And even if you specified one of the values (either lat OR long) for the point you're trying to find, it would still be ambiguous; as a circle is a many-to-many function, and you'll end up with 2 possible solutions.
You need to have some more info.
Imagine a point on the Earth. Now draw a circle around this point with a radius of "distance". The corresponding lat/long values that you're looking for could be _anywhere_ on the circumference of that circle.
And even if you specified one of the values (either lat OR long) for the point you're trying to find, it would still be ambiguous; as a circle is a many-to-many function, and you'll end up with 2 possible solutions.
You need to have some more info.
if everything always has the same longitude value, then 50 miles would be about .7228 degrees of latitude
(a little more near the equator, a little more near the poles)
(a little more near the equator, a little more near the poles)
ASKER
latitude would always be same. 1 degree = 69.2 miles so latitudedelta = 1*50/69.2
But I need exact value for longitude, how can I figure out the exact difference as distance in 1 degree of longitude differs at equator and poles.
But I need exact value for longitude, how can I figure out the exact difference as distance in 1 degree of longitude differs at equator and poles.
Approcimating the earth as an ellipsoid http://kai.er.usgs.gov/ftp/PROJ.4/proj.html
This formula for R gives but a rough approximation to the radius of curvature as a function of latitude. The radius of curvature varies with direction and latitude; according to Snyder ("Map Projections - A Working Manual", by John P. Snyder, U.S. Geological Survey Professional Paper 1395, United States Government Printing Office, Washington DC, 1987, p24), in the plane of the meridian it is given by
R' = a * (1 - e^2) / (1 - e^2 * sin^2(lat))^(3/2)
where a is the equatorial radius, b is the polar radius, and e is the eccentricity of the ellipsoid = (1 - b^2/a^2)^(1/2).
R' = a * (1 - e^2) / (1 - e^2 * sin^2(lat))^(3/2)
where a is the equatorial radius, b is the polar radius, and e is the eccentricity of the ellipsoid = (1 - b^2/a^2)^(1/2).
But when you take into account the fact that the Earth is not quite a sphere, there are subtly different ways of defining "latitude", so you may need to ask a more precise question to get a more precise answer.
ASKER
I have used haversine formula to calculate the distance
distance(lat1, long1, lat2, long2) = DOUBLE_EARTH_RADIUS * atan2(sqrt
((sin((lat2-lat1)/2))^2 + cos(lat1) * cos(lat2) * (sin((lon2-lon1)/2)) ^2), sqrt(1-a))
distance(lat1, long1, lat2, long2) = DOUBLE_EARTH_RADIUS * atan2(sqrt
((sin((lat2-lat1)/2))^2 + cos(lat1) * cos(lat2) * (sin((lon2-lon1)/2)) ^2), sqrt(1-a))
http://academic.brooklyn.cuny.edu/geology/leveson/core/linksa/lat_long.html
hec",)