Simplified version of distance between two point on earth?

112 Views Asked by At

Is there a more simple version of the formula between two points on earth surface taking into consideration that one of the points is always in the equator, thus having latitude equal to zero AND it will be on the same longitude?

Im writing a program that needs this and any kind of optimization would be very welcome

Eg: If the destination point is 32'54N 17'65W the start point will be 0N 17'65W

2

There are 2 best solutions below

0
On BEST ANSWER

I have found a implementation with more precision than the one provided by George:

double rad(double angle) => angle * 0.017453292519943295769236907684886127d; // = angle * Math.Pi / 180.0d
double havf(double diff) => Math.Pow(Math.Sin(rad(diff) / 2d), 2); // = sin²(diff / 2)
return 12745600 * Math.Asin(Math.Sqrt(havf(lat))); // earth radius 6.372,8km x 2 = 12745.6
1
On

The earth is 40,075 km in circumference so each degree is 40075/360= 111.32 km. 32 degree, 54 minutes= 32+ 54/60= 32.9 degrees so has a length of (111.32)(32.9)= 3662.43 km.