Equation of a great circle passing through two points

I've searched everywhere for something to help me with this problem, but I can't find anything. What I want to calculate is the midpoint between two locations (latitude and longitude) on a sphere. The midpoint must lie on the shortest path between them. And for this, I need the equation of the great circle on this sphere that passes through these two points.

What I tried to do is first start with an arbitrary great circle given by the following parametric equation:

${x=0}$

${y=cos\space \theta}$

${z=sin\space \theta}$

Or:

$\left( \begin{array}{} 0 \\ cos\space \theta \\ sin\space \theta \end{array} \right)$

Then if we multiply this vector by three rotation matrices $R_x, R_y,$ and $R_z$ about angles $\alpha, \beta,$ and $\gamma$, and then solve the equations for the rotation angles using our known values of the radius and the coordinates of the two points, we should get the exact equations of this circle in 3D space, but the trigonometric equations are extremely messy and I'm not sure if my assumption is correct.

There must be a statement of the equation somewhere but I just can't find it. What is it?

Perhaps a simpler method would be to calculate the midpoint in geographic coordinates and then convert them to cartesian, but I'm not sure how geometry works in geographic coordinates.

• I have worked out the explicit expressions in $(r,\theta)$ of points, geodesics, laplacian, and almost everything else on sphere, where $(r,\theta)$ are local coordinates on the stereographical projection of the sphere minus $N$ onto $R^2.$ If you're desperate enough to want it, tell me! May 13, 2016 at 13:40
• @Behnam Yes it can be found using stereographical projection. But as long as Hex4869 needs this very specific resul, it's shorter, as he considers, to transform spherical -> cartesian -> doing the businness in cartesian -> back to spherical. May 13, 2016 at 14:28
• But, wait minute! If we use spherical $(\theta, \phi)$, won't the answer be the average of the two $\theta$'s and the two $\phi$'s? Just a guess. May 13, 2016 at 16:02
• No risk. Of course, if $(\theta_k,\lambda_k) \ k=1,2$ are not far away one from the other, we know that the result will not be very different from the average you are speaking about. May 14, 2016 at 7:38

In the following, we consider that we are working on a unit sphere ($$\|V_1\|=\|V_2\|=1$$).

If your longitude and latitude coordinates are $$(\theta_k,\lambda_k) \ k=1,2.$$ Let

$$V_1=\begin{bmatrix}\cos \theta_1 \cos \lambda_1 \\ \sin \theta_1 \cos \lambda_1 \\ \sin \lambda_1 \end{bmatrix} \ \ \ V_2= \begin{bmatrix}\cos \theta_2 \cos \lambda_2 \\ \sin \theta_2 \cos \lambda_2 \\ \sin \lambda_2 \end{bmatrix}$$

Set $$V_3=V_1+V_2$$, and $$V_4=\dfrac{V_3}{\|V_3\|}$$: it is the desired point.

If one desires the spherical coordinates of $$V_4$$ out of its cartesian coordinates $$(a,b,c)$$, it suffices to set : $$\lambda = \text{asin}(c) \ \ \ \text{and} \ \ \ \theta = \text{asin}(\dfrac{b}{\cos \lambda})$$

Remark : if one wants a parametrized equation for the great circle passing through $$V_1$$ and $$V_2$$, here is a classical way to obtain it (cometimes called "orthonormalization"). It suffices to obtain an orthogonal basis of plane $$(P)$$ defined by $$V_1$$ and $$V_2$$. This is easily done by taking as first vector $$V_1$$ and as a second vector a linear combination $$V=\alpha V_1+\beta V_2$$ such that $$\|V\|^2=1$$ and $$V \perp V_1 \iff V \cdot V_1=0$$, generating two equations with two unknowns (let us recall that we have assumed that $$\|V_1\|=\|V_2\|=1$$):

$$\begin{cases}\alpha^2 +\beta^2+ 2 d \alpha \beta &=&1\\\alpha+d \beta=0\end{cases}\tag{1}$$

(where $$d$$ is defined as the dot product $$d:=V_1\cdot V_2$$) which is amenable to a quadratic equation with two solutions (in general) because its discriminant is $$>0$$.

Let $$W_1=\alpha V_1+\beta V_2$$ be one of these two solutions ; the looked for parametric equation of the great circle passing through $$V_1$$ and $$V_2$$ is

$$V = \cos(t) V_1 + \sin(t) W_1$$

• Wow, as simple as that? Thank you very much. May 14, 2016 at 6:36
• Elegant solution. Given the reasoning is not explained, one way to think of this is that V_3 is the vector addition of V_1 and V_2 so will point in the direction of the mid point. V_4 normalises V_3 so it lies on the unit sphere, and so is the projection of the mid point onto the unit sphere. Also note that the normal order for longitude and latitude is latitude-longitude. Oct 25, 2017 at 15:38
• An ugly formula completely in spherical coordinates: mathematica.stackexchange.com/questions/180422/…
– user2469
Aug 22, 2018 at 15:27
• How can I use this to draw a path a long a great circle between two points on a map? I want to use the equirectangular projection for example. Jul 26, 2019 at 8:56
• @Kuba Szymanowski If I understand well you question, you want to parameterize the path between $V_1$ and $V_2$ ? Directly, set $V_t :=(1-t)V_1+tV_2$, then $W_t:=V_t/\|V_t\|$ ($t \in [0,1]$). Jul 26, 2019 at 9:10