按照球面算,公式大概是这样的吧:
theta 纬度,phi经度
x = r sin theta sin phi
y = r sin theta cos phi
z = r cos theta;
//两点之间的直线距离。
d = sqrt( (x1*x1 - x0*x0) + (y1*y1 - y0*y0) + (z1*z1 - z0*z0));
rad = 2* arccos (d/2/r);
ds1 =rad* r ;
ds2 =2 * pi *r - rad * r;
精确点,则要按照旋转椭球面计算。
大概方程如下 :
(x^2+ y^2)/a^2 + z^2 /c^2 =1;
可以按照,曲线积分求两点间的弧长。或者按照在截面上的位置求弧长。