[Math] Interpolation between 2 points on the perimeter of a circle

circlesinterpolationtrigonometryvectors

I'm trying to produce movement on a unit circle from one point to another in equal increments, but I'm having trouble doing this without the use of angles (which isn't an option).

Given 2 points on a unit circle, a from position and a to position, how do I interpolate between the two positions given an amount to interpolate by t?

i.e.:

from = [0,1]

to = [1,0]

t = .25 (A quarter way between from and to on the perimeter of the unit circle)

Unfortunately, I don't think linear interpolation projected on the unit circle would work:

enter image description here

Is there a way to interpolate on the perimeter of the circle as shown here?

enter image description here

R, A, and B are segments of the circle's perimeter. |R| = |A| and |R| * 2 = |B|.

Best Answer

The interpolation you want is a linear interpolation of the angle (which is identical to the arclength for the unit circle): $$ \phi = \phi_a (1-t)+\phi_b t $$ which could involve segments of length more than $\pi$. If the shortest path is wanted, one needs to modify the above.

The problem is that you would need to calculate:

  1. $\phi_a$ and $\phi_b$ from $(x_a, y_a)$ and $(x_b, y_b)$, and then

  2. $(x, y)$ from $\phi$

The first is calculated via $\arctan(x)$ the second via $\cos(x)$ and $\sin(x)$ or one of them replaced by the square root function.

So your real problem is to approximate the above functions.

If you have restrictions on using trigonometric functions and their inverses, then you probably have more restrictions (maybe even no floating point arithmethic). We would need more information on them, to give useful advice. E.g. using symmetry and a lookup table for $\cos$ for the first $1/8$th of the circle might fail due to having not much memory etc.

Another approach would be to approximate the circle by a polygon:

circle approximation

Assign each line segment a parameter interval $[t_i, t_{i+}]$. So first step would be to look at $t$ and determine which interval applies e.g. $[t_3, t_4] = [0.75,1.00]$ and then do the interpolation on that segment.

This would only need in advance calculation and storage of the segement end points, e.g. $5$ points for the image above with $4$ segments. If you use symmetry only about half of the points are needed.