Calculated on the latitude and longitude of two [Teaks & xgluxv]

First, the
meridian circumference (km)
 40008.548
 
equatorial circumference (km)
 40075.704

Latitude
40008.548 / 360 (degrees) = 111.135 km / degree
40008.548 / (360 * 60) (min) = 1.85 km / min
40008.548 / (360 * 60 * 60) (sec) = 30.87 m / s

Longitude
first count of latitude length of the respective longitudinal position of = 40075.704 * cos (longitude)
and the same method, in addition to the degree to become
Accordingly, such Beijing 40 degrees
40075.704 * COS (40) = 30699.77
40075.704 * COS (40) / 360 (degrees) = 85.277 km / degree
40075.704 * cos (40) / 360 * 60) ( min) = 1.42 km / min
40075.704 * cos (40) / 360 * 60 * 60) ( sec) = 23.688 m / s

Annex:
COS (A) = SiN (A-90)
Second, the distance between the two points is calculated latitude and longitude of two points known of
this I wrote a function with c #

None.gif          public   static   double  GetDistance( double  ox,  double  oy,  double  dx,  double  dy)
ExpandedBlockStart.gifContractedBlock.gif        
dot.gif {
InBlock.gif            
double wd1 = ox;
InBlock.gif            
double wd2 = dx;
InBlock.gif            
double jd1 = oy;
InBlock.gif            
double jd2 = dy;
InBlock.gif            
double R = 6.371229 * 1000000.0;
InBlock.gif            
double x,y,outdis;
InBlock.gif            x 
= (jd2 - jd1) * Math.PI * R * Math.Cos(((wd1 + wd2) / 2* Math.PI / 180/ 180;
InBlock.gif            y 
= (wd2 - wd1) * Math.PI * R / 180;
InBlock.gif            outdis 
= Math.Sqrt(x * x + y * y);
InBlock.gif            
return outdis / 1000;
ExpandedBlockEnd.gif        }

ox, oy is the starting point of latitude and longitude, dx, dy latitude and longitude output destination is a few kilometers
here we regard the Earth as an ideal state, but also the approximate calculation
yourself to be a record.

Reproduced in: https: //www.cnblogs.com/dotLive/archive/2006/07/24/458438.html

Guess you like

Origin blog.csdn.net/weixin_34279246/article/details/93765081