Parametric Equation for Great Circle

10.7k Views Asked by At

So I've been doing a lot of searching and haven't found exactly what I'm looking for. My math skills are a bit rusty, so I haven't had luck deriving this on my own.

What I'm looking for is an equation (or set of equations) where I can plug in starting and ending spherical coordinates, plus a percentage (ie [0,1]) and output spherical coordinates of some point in between (ie, progress along a great circle).

The idea is basically to chart the progress of a plane between two cities and draw it on a globe or map.

Inputs:

  • lat1,lon1
  • lat2,lon2
  • r (radius)
  • p (progress, from 0->1)

Output:

  • lat_x,lon_x (point in-between)
2

There are 2 best solutions below

8
On

Ok, so I found what I was looking for at Ed Williams' awesome Aviation Formulary:

Given (lat1,lon1), (lat2,lon2), and progress fraction f=[0,1]

d = acos(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon1 - lon2))
A = sin((1 - f) * d) / sin(d)
B = sin(f * d) / sin(d)
x = A * cos(lat1) * cos(lon1) + B * cos(lat2) * cos(lon2)
y = A * cos(lat1) * sin(lon1) + B * cos(lat2) * sin(lon2)
z = A * sin(lat1) + B * sin(lat2)

lat_f = atan2(z, sqrt(x^2 + y^2))
lon_f = atan2(y,x)

2
On

Perhaps the most succinct and easiest answer is (as quoted from here)

You are given two points $u$ and $v$ on the unit sphere. Think of them as position vectors $\vec u$ and $\vec v$ . It is easy enough to calculate cross products. Calculate $\vec w = (\vec u \times \vec v)\times\vec u$. Then $\vec w$ and $\vec u$ are unit vectors perpendicular to each other and in the plane of the circle. So a parameterization of the circle is $$\vec R (t)=\vec u \cos t+\vec w \sin t.$$

Correction: $\vec w$ is only a unit vector if $\vec u$ and $\vec v$ are perpendicular.