Calculation of distance by the use of latitude and longitude?
How to calculate the distance between two places if we know the longitude and latitude of the two places?
Public Comments
- You are treading in some deeper waters with that question. First of all, it is important to realize what longitude and lattitude is. They are the sphereical coordinates for our globe - longitude measures the "up-down" ANGLE(usually denoted by the Greek letter phi) and lattitude the "left right" ANGLE. Note that I said ANGLE. Not distance, as it may be for cartesian (x,y,z) coordinates. Angle, as you know, will not yield the distance from one point on the sphere to the other. What you are trying to find is the ARC LENGTH. The process is not pretty. Read on. Now we have to derive the parametric equations of the curve that traces in sphereical coordinates. You will need to know the radius of the earth. It happens to be 6,356.750 km. So we will construct an equation for a sphereical-cross section curve that passes through the two points (two places) I am too lazy to derive the equation. When you do, you will have to plug it in the arc length equation: L = integral from a to b of the squareroot of (dp/dt)^2 + p^2 sin(a)^2 (db/dt)^2 + p^2 (da/dt)^2 dt where a = longitude and z = lattitude
- It depends on how accurate you want the answer. For pretty good results, use these formulas: R = earth’s radius (mean radius = 6,371 km) Δlat = lat2− lat1 Δlong = long2− long1 a = sin²(Δlat / 2) + cos(lat1) * cos(lat2) * sin²(Δlong / 2) c = 2atan2(√a, √(1−a)) d = R * c If you want more accurate results, taking into consideration the ellipsoid shape of the Earth, then you need to use the formula developed by Vincenty. If you want even more accuracy, including the effects of mountains and valleys, you are going to need a digital 3-D map of the Earth.
Powered by Yahoo! Answers