# Kinematics of points and rigid bodies

This page derives, step by step, the formulas used in the rest of the lesson to compute velocities and accelerations.
They are all obtained by differentiating position vectors with the rules from the {doc}`L02_01a_vector_review`, and they all rest on a single result: the time derivative of a constant-length vector attached to a rotating body.

## Kinematic state of points and rigid bodies

Kinematics describes the motion of two kinds of entities: **points** and **rigid bodies**.
A point has no dimensions; usually we are interested in points that belong to a link, so describing the motion of a point is describing the motion of one part of a rigid body.

The key difference between both is that a rigid body also has an **orientation**, which changes over time. For a point with position $\vec{x}(t)$ in a Cartesian coordinate system:

| | |
|---|---|
| Position | $\vec{x}(t)$ |
| Velocity | $\vec{v}(t) \equiv \dot{\vec{x}}(t) = \frac{d}{dt}\vec{x}(t)$ |
| Acceleration | $\vec{a}(t) \equiv \ddot{\vec{x}}(t) = \frac{d^2}{dt^2}\vec{x}(t)$ |

while for a rigid body we need the position of one of its points, $\vec{x}(t)$, **and** its orientation $\boldsymbol{\theta}(t)$:

| | Linear | Angular |
|---|---|---|
| Position | $\vec{x}(t)$ | $\boldsymbol{\theta}(t)$ |
| Velocity | $\vec{v}(t) \equiv \dot{\vec{x}}(t)$ | $\vec{\omega}(t)$ |
| Acceleration | $\vec{a}(t) \equiv \ddot{\vec{x}}(t)$ | $\vec{\alpha}(t) \equiv \dot{\vec{\omega}}(t)$ |

Any point of the body can be chosen as the reference point; the usual choices are its center of gravity or one of its joints with other links.
Linear velocities and accelerations **are different for each point** of a rigid body (unless it moves in pure translation), while the angular velocity $\vec{\omega}$ and angular acceleration $\vec{\alpha}$ **are the same for the whole body**.

In planar motion the orientation is a single angle $\theta$, measured from the $X$ axis, and $\vec{\omega} = \dot{\theta}\,\hat{k}$, $\vec{\alpha} = \ddot{\theta}\,\hat{k}$.
In 3D, orientation needs three parameters, and $\vec{\omega}$ is in general **not** the derivative of any set of angles; the next sections only use its properties.

## Intrinsic coordinates

The motion of a point along its path $\vec{r}(t)$ can be described in any coordinate system. A particularly insightful one is the **intrinsic coordinate system**, attached to the path itself.

```{image} figs/teoria_cin_an/intrinsic_coords.svg
:width: 520px
:align: center
```

*Intrinsic coordinates of point $A$ on its path: tangent ($\vec{\epsilon}_t$) and normal ($\vec{\epsilon}_n$) unit vectors, center of curvature $C$ and radius of curvature $R$. The acceleration $\vec{a}$ splits into a tangential component $\vec{a}_t$ and a normal component $\vec{a}_n$.*

Let $s(t)$ be the arc length traveled along the path, from its starting point until time $t$. This function says nothing about the *shape* of the path, which is set by $\vec{r}$, but it describes *how fast* the path is traveled.
Applying the chain rule to the position:

$$
\vec{v} = \frac{d\vec{r}}{dt} = \underbrace{\frac{d\vec{r}}{ds}}_{\vec{\epsilon}_t}\;\underbrace{\frac{ds}{dt}}_{\dot{s}} = \dot{s}\,\vec{\epsilon}_t
$$

$d\vec{r}/ds$ is a unit vector, since an infinitesimal displacement $|d\vec{r}|$ along the path has the same length as the arc $ds$, and it is tangent to the path.
So the velocity always has magnitude $v = \dot{s}$ and is **tangent to the path**.

Differentiating again with the product rule:

$$
\vec{a} = \frac{d}{dt}\left(\dot{s}\,\vec{\epsilon}_t\right) = \ddot{s}\,\vec{\epsilon}_t + \dot{s}\,\frac{d\vec{\epsilon}_t}{dt}
$$

The first term is along the tangent and has magnitude $\ddot{s}$: it is zero when the path is traveled at constant speed.
The second term comes from the change of **direction** of the tangent. To evaluate it in a planar path, let $\varphi$ be the angle of the tangent, so that $\vec{\epsilon}_t = \cos\varphi\,\hat{i} + \sin\varphi\,\hat{j}$:

$$
\frac{d\vec{\epsilon}_t}{dt} = \dot{\varphi}\,(-\sin\varphi\,\hat{i} + \cos\varphi\,\hat{j})
$$

The vector in parentheses is $\vec{\epsilon}_t$ rotated $90^\circ$, perpendicular to the path.
Near any point, the path can be approximated by an arc of the circle that best fits it (the *osculating circle*), of radius $R$ (the **radius of curvature**) and center $C$ (the **center of curvature**).
Along that arc, $ds = R\,d\varphi$, so $|\dot{\varphi}| = \dot{s}/R = v/R$, and the derivative of the tangent always points towards the center of curvature.
Calling $\vec{\epsilon}_n$ the unit normal vector pointing towards $C$:

$$
\frac{d\vec{\epsilon}_t}{dt} = \frac{v}{R}\,\vec{\epsilon}_n
$$

and the acceleration of any point always has two components:

$$
\vec{a} = \vec{a}_t + \vec{a}_n = \underbrace{\ddot{s}\,\vec{\epsilon}_t}_{\text{tangential}} + \underbrace{\frac{v^2}{R}\,\vec{\epsilon}_n}_{\text{normal (centripetal)}}
$$

* The **tangential acceleration** is due to the change in the **magnitude** of the velocity.
* The **normal (centripetal) acceleration** is due to the change in the **direction** of the velocity, and always points towards the center of curvature.

The total acceleration lies on the plane defined by $\vec{\epsilon}_t$ and $\vec{\epsilon}_n$, and has no component perpendicular to it.
In rectilinear motion $R \to \infty$ and the normal acceleration vanishes.
For a planar path given as $y = f(x)$, and for a general 3D path, the radius of curvature is:

$$
R = \frac{\left(1 + \left(\frac{dy}{dx}\right)^2\right)^{3/2}}{\left|\frac{d^2y}{dx^2}\right|}, \qquad
R = \frac{|\vec{v}|^3}{|\vec{v} \times \vec{a}|}
$$

:::{admonition} Summary: intrinsic coordinates
:class: tip

| | |
|---|---|
| Path | $\vec{r}(t)$ |
| Arc length traveled | $s(t)$ |
| Directions | tangent $\vec{\epsilon}_t$, normal $\vec{\epsilon}_n$ (towards the center of curvature) |
| Velocity | $\vec{v} = \dot{s}\,\vec{\epsilon}_t$ |
| Acceleration | $\vec{a} = \ddot{s}\,\vec{\epsilon}_t + \dfrac{v^2}{R}\,\vec{\epsilon}_n$ |
:::

## Angular velocity

Although there are several ways of describing the orientation of a body in space (rotation matrices, quaternions, Euler angles, ...), there is a single vector that describes how that orientation **changes**: the **angular velocity** $\vec{\omega}$. Its properties are:

* $\vec{\omega}$ is a free vector: it is not attached to any particular point of the body.
* All points of a rigid body share the same angular velocity.
* Its magnitude $|\vec{\omega}|$ is the rotation speed of the body, in rad/s.
* It lies along the instantaneous axis of rotation, and its sense follows the right-hand rule.
* If two reference frames (or rigid bodies) $A$ and $B$ keep a constant relative orientation, $\vec{\omega}_{A/B} = \vec{0}$.
* Always, $\vec{\omega}_{A/B} = -\vec{\omega}_{B/A}$.
* Usually we need the angular velocity relative to the fixed (inertial) frame $O$. In that case the simplified notation $\vec{\omega}_A \equiv \vec{\omega}_{A/O}$ is used.

The **addition theorem** is especially useful in practice. For any three reference frames $A$, $B$ and $C$:

$$
\vec{\omega}_{A/C} = \vec{\omega}_{A/B} + \vec{\omega}_{B/C}
$$

where $C$ is often the fixed frame and is then omitted from the notation.
For example, the angular velocity of a link equals that of the link it is pinned to, plus its rotation relative to it.

:::{warning}
Angular velocities can always be added, but angular **accelerations** cannot, in general, be obtained by just adding the relative ones: when a relative angular velocity changes its direction (because it is carried by a rotating body), its derivative has an extra term (see below).
This never happens in planar mechanisms, where all angular velocities are parallel to $\hat{k}$.
:::

## Time derivative of a constant-length vector

All the formulas below come from repeatedly differentiating vectors. The key case is that of a vector of **constant magnitude** attached to a moving reference frame (or rigid body).

### Translating vector

If the frame only translates (no rotation), the vector $\vec{a}$ simply moves with it, keeping its magnitude and direction.

```{image} figs/teoria_cin_an/derivada_vector_translacion.png
:width: 400px
:align: center
```

*A vector of constant length moving in pure translation.*

A vector represents a magnitude and a direction, not a position, so moving it around does not change its coordinates. Therefore:

$$
\frac{d\vec{a}}{dt} = \vec{0} \qquad \text{(constant $|\vec{a}|$, pure translation)}
$$

### Rotating vector

If the frame rotates with angular velocity $\vec{\omega}$, the coordinates of $\vec{a}$ in the fixed frame do change over time, even though the vector is "fixed" relative to the rotating frame.

```{image} figs/teoria_cin_an/derivada_vector_rotacion.png
:width: 300px
:align: center
```

*A vector of constant length that rotates with angular velocity $\vec{\omega}$.*

Let us first derive the result for planar rotation. A vector of length $L$ that forms an angle $\theta(t)$ with the $X$ axis is $\vec{a} = L\cos\theta\,\hat{i} + L\sin\theta\,\hat{j}$. Differentiating with $L$ constant:

$$
\frac{d\vec{a}}{dt} = L\,\dot{\theta}\,(-\sin\theta\,\hat{i} + \cos\theta\,\hat{j})
$$

The right-hand side is exactly the cross product $\dot{\theta}\,\hat{k} \times (L\cos\theta\,\hat{i} + L\sin\theta\,\hat{j})$, as the $\hat{k} \times$ rule from the vector review shows. With $\vec{\omega} = \dot{\theta}\,\hat{k}$:

$$
\frac{d\vec{a}}{dt} = \vec{\omega} \times \vec{a}
$$

The result also holds in 3D. Split $\vec{a}$ into a component parallel to $\vec{\omega}$ and a component perpendicular to it. The parallel component lies on the rotation axis and does not change; the perpendicular one rotates on the plane normal to $\vec{\omega}$ exactly as in the planar case, so its derivative is $\vec{\omega} \times \vec{a}_\perp$. Since $\vec{\omega} \times \vec{a}_\parallel = \vec{0}$, both can be put together:

$$
\boxed{\frac{d\vec{a}}{dt} = \vec{\omega} \times \vec{a}} \qquad \text{(constant $|\vec{a}|$, rotating with $\vec{\omega}$)}
$$

This derivative is always perpendicular to $\vec{a}$, as it must be for a vector whose length does not change: differentiating $\vec{a} \cdot \vec{a} = |\vec{a}|^2 = \text{const}$ gives $2\,\vec{a} \cdot \dot{\vec{a}} = 0$.

The vector $\vec{a}$ can be any physical quantity: a relative position between two points, a unit vector of a moving frame, or even an angular velocity carried by a rotating body.
Every formula in the rest of this page is an application of this result.

## Point of a rigid body

Consider a rigid body and two of its points, $A$ and $B$. If we know the velocity and acceleration of $A$ and the angular velocity of the body, we can find the velocity and acceleration of any other point $B$.

```{image} figs/teoria_cin_an/mov_relativo_solido_rigido.png
:width: 330px
:align: center
```

*Two points $A$ and $B$ of a rigid body that translates and rotates. Note that the velocity of $A$ may point in any direction, regardless of the angular velocity $\vec{\omega}$ of the body.*

From the figure, the position of $B$ is the sum of two vectors:

$$
\vec{r}_{OB} = \vec{r}_{OA} + \vec{r}_{AB}
$$

Differentiating, $\dot{\vec{r}}_{OA} = \vec{v}_A$, and $\vec{r}_{AB}$ is a constant-length vector (the body is rigid) that rotates with the body, so $\dot{\vec{r}}_{AB} = \vec{\omega} \times \vec{r}_{AB}$:

$$
\vec{v}_B = \vec{v}_A + \vec{\omega} \times \vec{r}_{AB}
$$

Differentiating once more, with the product rule for the cross product and using $\dot{\vec{r}}_{AB} = \vec{\omega} \times \vec{r}_{AB}$ again:

$$
\vec{a}_B = \vec{a}_A + \dot{\vec{\omega}} \times \vec{r}_{AB} + \vec{\omega} \times \dot{\vec{r}}_{AB}
= \vec{a}_A + \vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB})
$$

:::{admonition} Velocity and acceleration of two points of the same rigid body
:class: tip

$$
\begin{aligned}
\vec{v}_B &= \underbrace{\vec{v}_A}_{\text{transport}} + \underbrace{\vec{\omega} \times \vec{r}_{AB}}_{\text{relative: } \vec{v}_{B/A}} \\
\vec{a}_B &= \underbrace{\vec{a}_A}_{\text{transport}} + \underbrace{\vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB})}_{\text{relative: } \vec{a}_{B/A}}
\end{aligned}
$$
:::

All vectors in these equations are expressed in **global coordinates**, that is, in the system where we want to obtain the velocity or acceleration ($XYZ$ with origin $O$ in the figure).
To avoid confusion, it is advisable to keep all coordinate systems parallel to the global one.

Some consequences are the basis of the methods in this lesson:

* The relative velocity $\vec{v}_{B/A} = \vec{\omega} \times \vec{r}_{AB}$ is always **perpendicular to the segment $AB$**: seen from $A$, point $B$ can only rotate around it. Its magnitude is $\omega \cdot \overline{AB}$.
* Hence, the velocities of $A$ and $B$ have the **same projection** on the line $AB$ (the distance between both points cannot change).
* The relative acceleration has a **tangential** component $\vec{\alpha} \times \vec{r}_{AB}$, perpendicular to $AB$, and a **normal** component $\vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB})$, which points from $B$ towards $A$.

### Planar case

In planar motion $\vec{\omega} = \omega\,\hat{k}$ is perpendicular to every $\vec{r}_{AB}$ on the plane, so the triple product simplifies to $\vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB}) = -\omega^2\,\vec{r}_{AB}$, and:

$$
\begin{aligned}
\vec{v}_B &= \vec{v}_A + \omega\,\hat{k} \times \vec{r}_{AB} \\
\vec{a}_B &= \vec{a}_A + \underbrace{\alpha\,\hat{k} \times \vec{r}_{AB}}_{\vec{a}^t_{B/A}} \underbrace{- \,\omega^2\,\vec{r}_{AB}}_{\vec{a}^n_{B/A}}
\end{aligned}
$$

with magnitudes $v_{B/A} = |\omega|\,\overline{AB}$, $a^t_{B/A} = |\alpha|\,\overline{AB}$ and $a^n_{B/A} = \omega^2\,\overline{AB}$.

The simplest case is a link that rotates about a fixed pivot, $A$ (so $\vec{v}_A = \vec{a}_A = \vec{0}$), shown in the figure below for a point $P$. The velocity of $P$ is perpendicular to the link, the tangential acceleration is also perpendicular to the link (in the sense of $\alpha$), and the normal acceleration points from $P$ towards the pivot.
These are the intrinsic components of the previous section: the path of $P$ is a circle of radius $R = \overline{AP}$, so $v = |\omega| R$, $a_t = \dot{v} = |\alpha| R$ and $a_n = v^2/R = \omega^2 R$.

```{image} figs/fig_vel_acc.jpg
:width: 380px
:align: center
```

*Velocity and acceleration of a point $P$ of a link that rotates about a fixed pivot $A$.*

## Moving point in a moving reference frame

Now consider a moving reference frame with origin at point $A$, and a point $B$ that **moves relative to that frame**, as in the figure below.
As before, the velocity $\vec{v}_A$ and acceleration $\vec{a}_A$ of $A$ are known, and the frame rotates with angular velocity $\vec{\omega}$.
This is the situation of a slider moving along a rotating guide, or of a passenger walking on a moving vehicle.

```{image} figs/teoria_cin_an/mov_relativo_sistema_movil.png
:width: 380px
:align: center
```

*Moving frame with origin at $A$, relative to which point $B$ moves.*

We call **relative velocity** of $B$, $(\vec{v}_B)_A$, the velocity of $B$ as seen by an observer that moves and rotates with the frame, and **relative acceleration**, $(\vec{a}_B)_A$, the acceleration measured by that observer.
They must not be confused with the absolute velocity and acceleration $\vec{v}_B$, $\vec{a}_B$, measured in the fixed frame $O$.

Again, $\vec{r}_{OB} = \vec{r}_{OA} + \vec{r}_{AB}$, but now $\vec{r}_{AB}$ does not have a constant length. To differentiate it, write it with its coordinates in the moving frame, whose unit vectors are $\hat{i}'$, $\hat{j}'$ and $\hat{k}'$:

$$
\vec{r}_{AB} = x'\,\hat{i}' + y'\,\hat{j}' + z'\,\hat{k}'
$$

Both the coordinates and the unit vectors change with time. With the product rule:

$$
\dot{\vec{r}}_{AB} = \underbrace{\dot{x}'\,\hat{i}' + \dot{y}'\,\hat{j}' + \dot{z}'\,\hat{k}'}_{(\vec{v}_B)_A} + x'\,\dot{\hat{i}}' + y'\,\dot{\hat{j}}' + z'\,\dot{\hat{k}}'
$$

The first group is the velocity seen from the moving frame, for which the unit vectors are constant: it is the relative velocity. The unit vectors are constant-length vectors rotating with $\vec{\omega}$, so $\dot{\hat{i}}' = \vec{\omega} \times \hat{i}'$ (and the same for $\hat{j}'$, $\hat{k}'$), and the second group is $\vec{\omega} \times (x'\,\hat{i}' + y'\,\hat{j}' + z'\,\hat{k}') = \vec{\omega} \times \vec{r}_{AB}$. Therefore:

$$
\frac{d\vec{r}_{AB}}{dt} = (\vec{v}_B)_A + \vec{\omega} \times \vec{r}_{AB}
\qquad\rightarrow\qquad
\vec{v}_B = \vec{v}_A + (\vec{v}_B)_A + \vec{\omega} \times \vec{r}_{AB}
$$

This result is general: **the derivative of any vector in the fixed frame equals its derivative seen from the moving frame, plus $\vec{\omega}$ times the vector**.
Applying it to the relative velocity itself:

$$
\frac{d}{dt}(\vec{v}_B)_A = (\vec{a}_B)_A + \vec{\omega} \times (\vec{v}_B)_A
$$

Now we can differentiate the velocity equation term by term:

$$
\begin{aligned}
\vec{a}_B &= \vec{a}_A + \frac{d}{dt}(\vec{v}_B)_A + \dot{\vec{\omega}} \times \vec{r}_{AB} + \vec{\omega} \times \frac{d\vec{r}_{AB}}{dt} \\
&= \vec{a}_A + \Big[(\vec{a}_B)_A + \vec{\omega} \times (\vec{v}_B)_A\Big] + \vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times \Big[(\vec{v}_B)_A + \vec{\omega} \times \vec{r}_{AB}\Big]
\end{aligned}
$$

The term $\vec{\omega} \times (\vec{v}_B)_A$ appears twice. Grouping:

:::{admonition} Velocity and acceleration of a point that moves relative to a moving frame
:class: tip

$$
\begin{aligned}
\vec{v}_B &= \underbrace{\vec{v}_A + \vec{\omega} \times \vec{r}_{AB}}_{\text{transport}} + \underbrace{(\vec{v}_B)_A}_{\text{relative}} \\
\vec{a}_B &= \underbrace{\vec{a}_A + \vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB})}_{\text{transport}} + \underbrace{(\vec{a}_B)_A}_{\text{relative}} + \underbrace{2\,\vec{\omega} \times (\vec{v}_B)_A}_{\text{Coriolis}}
\end{aligned}
$$
:::

The **transport** terms are the velocity and acceleration that $B$ would have if it were rigidly attached to the moving frame (the coincident point of the frame), and the **relative** terms are those measured by the moving observer.
The extra term, the **Coriolis acceleration** $2\,\vec{\omega} \times (\vec{v}_B)_A$, collects two effects of the same size: the rotation of the frame changes the direction of the relative velocity, and the relative motion changes the distance to the rotation axis and, with it, the transport velocity $\vec{\omega} \times \vec{r}_{AB}$.
It is zero only if the frame does not rotate, if the point does not move relative to it, or if both vectors are parallel.

The rigid-body formulas of the previous section are a particular case of these: if $B$ is fixed to the moving frame, $(\vec{v}_B)_A = (\vec{a}_B)_A = \vec{0}$.

### Planar case: slider on a rotating guide

In planar mechanisms this situation appears whenever a point slides along a link that rotates, such as a slider block on a rotating guide.
Let $P_3$ be the point of the slider (link 3) and $P_4$ the coincident point of the guide (link 4), which rotates with $\omega_4$. Taking link 4 as the moving frame, the equations above become:

$$
\begin{aligned}
\vec{v}_{P_3} &= \vec{v}_{P_4} + \vec{v}_{P_3/P_4} \\
\vec{a}_{P_3} &= \vec{a}_{P_4} + \vec{a}_{P_3/P_4} + 2\,\vec{\omega}_4 \times \vec{v}_{P_3/P_4}
\end{aligned}
$$

where $\vec{v}_{P_4}$ and $\vec{a}_{P_4}$ are obtained with the rigid-body formulas for link 4, and the relative velocity $\vec{v}_{P_3/P_4}$ is **along the guide**.
If the guide is straight, the relative acceleration $\vec{a}_{P_3/P_4}$ is also along the guide; if it is curved, it has an additional normal component $v_{P_3/P_4}^2/\rho$ towards the center of curvature of the guide (radius $\rho$), as seen in the intrinsic coordinates section.

In the plane, $2\,\omega_4\,\hat{k} \times \vec{v}_{P_3/P_4}$ is the relative velocity rotated $90^\circ$ **in the sense of $\omega_4$** and scaled by $2|\omega_4|$, which gives a quick way of drawing its direction.
Its use in planar mechanisms is detailed in {doc}`L02_04_acceleration_analysis`.

## Summary

| Case | Velocity | Acceleration |
|---|---|---|
| Constant-length vector rotating with $\vec{\omega}$ | $\dot{\vec{a}} = \vec{\omega} \times \vec{a}$ | |
| Two points of a rigid body | $\vec{v}_B = \vec{v}_A + \vec{\omega} \times \vec{r}_{AB}$ | $\vec{a}_B = \vec{a}_A + \vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB})$ |
| Moving point in a moving frame | $\vec{v}_B = \vec{v}_A + \vec{\omega} \times \vec{r}_{AB} + (\vec{v}_B)_A$ | $\vec{a}_B = \vec{a}_A + \vec{\alpha} \times \vec{r}_{AB} + \vec{\omega} \times (\vec{\omega} \times \vec{r}_{AB}) + (\vec{a}_B)_A + 2\,\vec{\omega} \times (\vec{v}_B)_A$ |

Examples {doc}`L02_16_example12` and {doc}`L02_17_example13` apply these formulas to 3D problems, where a mechanism is mounted on a rotating platform.
