TITLE: How do you find a geodesic on an ellipsoid?
QUESTION [9 upvotes]: This question has been asked twice but not been answered on this site, and I really need to understand this concept. 
All I want is, based on 2 arbitrary points A and B on a given ellipsoid, to find the geodesic containing those 2 points.

REPLY [2 votes]: The following addresses only initial values only.
If all geodesics are tangent to circle 
$$ x^2+y^2= r_{min}^2 @  \,r=r_{min}$$
as the Clairaut constant then for an ellipsoid of revolution
$$ (z/c)^2+(r/a)^2 = (z/c)^2+(x^2+y^2)/a ^2 = 1 $$
we differentiate to find meridian slope
$$ \tan \phi=-(a/c) \sqrt{(a/r)^2-1}, $$
and $r=f(\theta) $ is found by integration (to get elliptic integral result)
$$ \frac{dr}{r \, d\theta}= \sin\phi \, \sqrt{1-(r/r_{min})^2 }.$$
similarly $z$ can be set up. We have $ (r,z)$ as functions of $\theta$
With given $ (r_B,r_A), \theta_{AB}, (z_B,z_A) $ we cannot directly use this, however..
we can start with initial conditions $(r_B, \theta_A =0, z_A ) $ but to arrive at last point we can vary /adjust Clairaut constant $r_{min}$ several small increments in a numerical procedure.