Convert latitude and longitude to Cartesian coordinates. Use the Pythagorean theorem to find the straight line distance (through the earth) between the two points. You now know the lengths of all three sides of the triangle formed by the radii to the two points and the line segment joining the points (since the radius of the earth is a known constant - I’m assuming here that the earth is a perfect sphere, which is not quite accurate). Knowing these three lengths you can use the law of cosines to solve for the angle formed by the two radii. This is the angle of arc on the great circle between your two points. This angle (in radians) times the radius of the earth gives your distance.
.3. Calculating Distances in Latitude and Longitude
* Calculating distance on a sphere based on latitude and longitude is a complicated task.
o The calulation of the distance between two points on a plane surface is a relatively simple task and has promoted the use of two-dimensional maps throughout history.
o When calculating distances over large areas, the authalic sphere can be used as a reference surface.
+ The shortest distance between two points on a sphere is the arc on the surface directly above the true straight line.
+ The arc is based on a great circle.
+ Table 3 - Great Circle Distance Calculation
+ See the Web References section for online examples.
o The difference betwen the sphere and ellipsoid is important when working with large areas.
+ At a scale of 1:40,000,000, a 23 kilometer error in distance would equal a pen line (0.5 mm) on paper.
o Complex geodetic models based on ellipsoids are necessary for precise meaurement.
+ Long range radio navigation requires precise distances.
+ Loran-C requires range computations with better than 10 meter accuracy over 2,000 kilometers.
+ Geodetic measurements using satellites requires very accurate range computations.
+ Table 4 - Ellipsoidal Distance Calculation
See, I know the formula that hw to calculate , let me explain what we have done. We have created a DLL in VB to calculate the values, basically the formula is in DLL, then I integreted that with navision, but I need to know , is there any other way that I can handle this within navision rather than going for third party DLL's???/.. :-k
Comments
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
* Calculating distance on a sphere based on latitude and longitude is a complicated task.
o The calulation of the distance between two points on a plane surface is a relatively simple task and has promoted the use of two-dimensional maps throughout history.
o When calculating distances over large areas, the authalic sphere can be used as a reference surface.
+ The shortest distance between two points on a sphere is the arc on the surface directly above the true straight line.
+ The arc is based on a great circle.
+ Table 3 - Great Circle Distance Calculation
+ See the Web References section for online examples.
o The difference betwen the sphere and ellipsoid is important when working with large areas.
+ At a scale of 1:40,000,000, a 23 kilometer error in distance would equal a pen line (0.5 mm) on paper.
o Complex geodetic models based on ellipsoids are necessary for precise meaurement.
+ Long range radio navigation requires precise distances.
+ Loran-C requires range computations with better than 10 meter accuracy over 2,000 kilometers.
+ Geodetic measurements using satellites requires very accurate range computations.
+ Table 4 - Ellipsoidal Distance Calculation
Copied from http://www.ncgia.ucsb.edu/giscc/units/u014/u014.html
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
See, I know the formula that hw to calculate , let me explain what we have done. We have created a DLL in VB to calculate the values, basically the formula is in DLL, then I integreted that with navision, but I need to know , is there any other way that I can handle this within navision rather than going for third party DLL's???/.. :-k
Plz guide me!
Roshan
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.