For context, my goal is to interpolate aircraft position data at a relatively low sample rate, and as planes do not turn (change their heading) on a dime, I would like to use something more accurate than linear interpolation to interpolate the said turns.

The best idea I could come up with is using a cubic Hermite spline or similar where I can use the heading of the aircraft at the two points to compute the first derivatives. The problem is that I need to do this in spherical coordinates as opposed to Cartesian ones. Slerp is a well known algorithm for linear spherical interpolation, which is trivial to implement, but I scoured the internet for an algorithm that would let me do such nonlinear spline interpolation but came out emptyhanded.

Here's a diagram of what I want to achieve. I drew it in terms of a Cartesian plane (which is a good approximation of what I'm doing at short distances and low latitudes anyway) but I of course want to achieve the same on a sphere. $f(t)$ represents a linear interpolation, $f(t) = \mathrm{Slerp}(p_1, p_2; t)$ in this case, while $g(t)$ is a spline with control points $p_1$ and $p_2$ which are tuples of spherical coordinates and their respective derivatives/tangents $p'_1$ and $p'_2$, $t \in [0, 1]$. $g(t)$ is what I am looking for.

Therefore, I would like to ask if anyone is aware of such an algorithm and can provide more information on how to implement it.

  • $\begingroup$ I don't know the answer but I have a remark. The same difficulty would arise when doing linear interpolation. If you know how to do linear interpolation on the sphere, chances are the same method will get you spline interpolation on the sphere. $\endgroup$ Commented Jul 18, 2022 at 8:38
  • $\begingroup$ I believe I used the wrong wording in the title. I'm specifically looking for spline interpolation, wherein I cannot take a regular linear interpolation and replace the linear parameter $t$ with a nonlinear function $f(t)$ which is often done in easing functions, but I need a whole new function to represent the spline. $\endgroup$
    – nufflee
    Commented Jul 19, 2022 at 3:24
  • $\begingroup$ While I cannot rigorously prove that this solution is mathematically correct, what I ended up using is a regular cubic Bezier curve (derived from a cubic Hermite curve) and replacing all the lerps used to create the curve with slerps. All I can say is that the results certainly look more like what I'd expect. $\endgroup$
    – nufflee
    Commented Jul 19, 2022 at 16:05
  • $\begingroup$ Unfortunately I know nothing about these things. I'm happy you seem to have found something, though. $\endgroup$ Commented Jul 19, 2022 at 19:42


You must log in to answer this question.

Browse other questions tagged .