# How to determine the coordinate of roller coaster's wheels?

I want to create an animation about roller coaster. For a simple track, for example, a circle, I can determine the position of the center of its wheel easily. However, for any parametric curve, I have no idea to determine the coordinates. Let's take a general case as follows. Given the parametric equation of a roller coaster's tracks as follows,

\begin{align} x &= f(t)\\ y &= g(t) \end{align}

where both are function of time t (for example).

A and B are the centers of the wheels with radius R. The distance between two wheels are kept constant d.

How can I determine the coordinate of A and B explicitly?

Provided the parametric curve $\vec{\gamma}(t) = (x(t), y(t))$ has a curvature smaller than $\frac{1}{R}$ (we assume the wheels always adheres to the rail), I think the curve followed by the points $A$ and $B$ is given by the $\vec{\beta}(t) = \vec{\gamma}(t) + R . \vec{N}(t)$ where $\vec{N}(t)$ is the unit normal vector.
Now let's say $A$ is at the point $\vec{\beta}(t_0)$, then $B$ is at a point $\vec{\beta}(t_1)$ with $t_1 > t_0$ such that $|\|\vec{\beta}(t_0)-\vec{\beta}(t_1)|\| = d$ (provided your track is reasonnable, and $d$ is small enough, there should be only one solution to this equation in $t_1$).