Date: Mon, 23 Jun 1997 08:57:04 -0400

From: Alexander Bogomolny

Hello:

Providing the algorithm is probably the best I can do. See if you can fill in the details.

- First of all, you must know formulas for spherical coordinates:
x = r cos(f) sin(g)

y = r sin(f) sin(g)

z = r cos(g)

where r is the radius of the sphere, f is the longitude, and g is the latitude of the point (x,y,z). The sphere is located with its center at the origin.

- Given two points a = (x
_{1},y_{1},z_{1}) and b = (x_{2},y_{2},z_{2}) on the sphere, one can find the angle between them from two formulas for the scalar product:a.b = |a| |b| cos(i) = x

_{1}x_{2}+ y_{1}y_{2}+ z_{1}z_{2}where |a| is the distance from a to the origin (the length of the corresponding vector), or sqrt(x

_{1}^{2}+ y_{1}^{2}+ z_{1}^{2}). - Now, it's like on a circle. One has to find the length of an arc on a circle of radius r subtending a given central angle i which is given by
length = i r

Sincerely,

Alexander Bogomolny

65650651