可计算经经度φ1, λ1和φ2, λ2两点的大圆。这个大圆的轴线在两个对映点与球体相交。这些点有名字吗?从φ1 λ1和φ2 λ2推导出它们的公式是什么?
你可以通过转换到笛卡尔坐标,取矢量叉乘,然后转换回球坐标来做到:-
def fromSpherical(point): # φ, λ -> x, y, x
φ, λ = point
θ, φ = π / 2 - φ, λ
return sin(θ) * cos(φ), sin(θ) * sin(φ), cos(θ)
def toSpherical(point): # x, y, x -> φ, λ
x, y, z = point
θ = acos(z)
φ = atan2(y, x)
return π / 2 - θ, φ
def nodes(pt1, pt2):
x1, y1, z1 = fromSpherical(pt1)
x2, y2, z2 = fromSpherical(pt2)
v = np.cross(np.array((x1, y1, z1)), np.array((x2, y2, z2)))
v /= np.linalg.norm(v)
return toSpherical(v), toSpherical(-v)