could any one the formula..
Please help me..
Thanks
Approx how far apart are the points, and how accurate do you need the answer
to be?
--
Cheers,
Roger
______
Email address maintained for newsgroup use only, and not regularly
monitored.. Messages sent to it may not be read for several weeks.
PLEASE REPLY TO NEWSGROUP!
> I want to calculate distance between two latitude,longitude.
Aviation Formulary V1.44
http://williams.best.vwh.net/avform.html
Assuming you are looking for the shortest distance between
start and finish points anywhere on the globe, this is a spherical
earth formula from Aviation Formulary coded in Pascal:
{Distance calculations from (Lat1, Lon1) to (Lat2, Lon2)}
function GcDis(const Lat1, Lon1, Lat2, Lon2: Double): Double;
begin
Result := 2*ArcSin(Sqrt(Sqr(Sin((Lat1-Lat2)/2)) +
Cos(Lat1)*Cos(Lat2)*Sqr(Sin((Lon1-Lon2)/2))));
end
You need to convert lat and lon to radians and then convert the
result from radians to your distance units. The spherical earth
model can be in error by several percent depending on the the
direction between the start and finish points.
This formula is very well behaved for small distance and handles
special cases properly.
There is a more complex formula available using the method of
Andoyer-Lambert that is more accurate for a ellipsoid shaped
earth. I have Pascal Code for it.
If the ultimate accuracy is required, you will need an iterative
algorithm such as the one developed by Thaddeus Vincenty.
Have fun.
--- CHAS
Hello,
When I was deep into geocaching, I wrote a bunch of utility routines.
One of them is called Vincenty, which will do exactly what you want
with great accuracy on the WGS84 Spheroid. You can find the routines
(free) here: http://dreamcachers.com/geocaching/DreamcachersWare.zip .
I typed in google:
"tool to calculate and display distances on a map"
and it found:
http://www.daftlogic.com/projects-google-maps-distance-calculator.htm
Good riddance,
Q
Others have replied with the formulas, here is a website that will do
it for you : http://www.csgnetwork.com/gpsdistcalc.html