# How to find all points along a great circle given two points on circle

Here are the equations for the great circle on a sphere of radius R centered at O (0,0,0) which passes through the 2 given points A = R (S1, 0 , C1) and B = R(CøS2, SøS2, C2).

ie we imagine the right handed coordinate system placed at the center of the sphere so that point A is on the zero longitude line and B is on the ø longitude line (with ø increasing in an easterly direction). The polar angle between OA and the z axis (north) is θA, and the angle between OB and z axis is θB. The following short hand notation is employed;

C1 = Cos θA
S1 = Sin θA

C2 = Cos θB
S2 = Sin θB

Cø = Cos ø
Sø = Sin ø

then:-

x/R = [Cosψ].S1 + [Sin ψ].{Cø.C12.S2 - S1C1C2}/Sinδ

y/R = [Sinψ].{Sø.S2 }/Sinδ

z/R = [Cosψ].C1 + [Sinψ].{S12.C2 - Cø.C1.S1.S2}/Sinδ

δ is the angle between OA and OB and is given by

Cosδ = Cø.S1.S2 + C1.C2

ψ is the only free parameter, as it increases from 0 to δ we sweep around the great circle from A
to B. as it continues to increase to 2π we go right around the great circle.

An even more general expression for the great circle passing through points A= R ( ax, ay, az) and B= R (bx, by, bz) nb (ax, ay, az) is the unit vector along OA:-

x/R = [Cosψ]. ax + [Sinψ].{(az2+ay2)bx - (azbz+ayby)ax}/sinδ

y/R= [Cosψ].ay + [Sinψ]{(az2+ax2)by - (azbz+axbx)ay}/sinδ

z/R= [Cosψ].az + [Sinψ]{(ay2+ax2)bz - (ayby+axbx)az}/sinδ

Cos δ = axbx + ayby + azbz