Hi,
Here is a code sample in Delphi:
Code:
function TRefPoints.GetDistance(Lat1, Lon1, Lat2, Lon2: double): integer;
var
Lat, Lon, Dist: double;
begin
Lat := Lat2 - Lat1;
Lon := (Lon2 - Lon1) * Cos(DegToRad((Lat1 + Lat2) / 2));
Dist := Hypot(Lat, Lon);
Result := Round(Dist * 1.852 * 60000); // meters
end;