# 2D Vehicle Physics

![force_diagram](images/force_diagram.svg)

Terminology:

$$
\begin{align}
CM &: \text{Center of Mass} \nonumber \\ 
A &: \text{Midpoint between front wheels} \nonumber \\ 
B &: \text{Midpoint between rear wheels} \nonumber \\ 
\vec F_A &: \text{Lateral force on the front wheels} \nonumber \\ 
\vec F_B &: \text{Lateral force on the rear wheels} \nonumber \\ 
\end{align}
$$

The relation of torque to angular acceleration and force is

$$
\begin{align}
\tau
&= \alpha I \nonumber \\
&= \vec r \times \vec F \nonumber \\
&= r_x F_y - r_y F_x \nonumber \\
\end{align}
$$

The acceleration of a point P is

$$
\begin{align}
\vec a_P
&= \frac{\vec F}{m} + |\vec P_{B/CM}| \cdot \alpha_{CM} \nonumber \\
\end{align}
$$


## Forces

### Force: Thrust

**Front-wheel drive:**
Positive force in the direction that the front wheels are facing (affected by steering).

**Rear-wheel drive:**
Positive force in the direction that the vehicle is facing.

### Force: Brakes/Reverse

**Front-wheel drive:**
Negative force in the direction that the front wheels are facing (affected by steering).

**Rear-wheel drive:**
Negative force in the direction that the vehicle is facing.

Stronger force if vehicle is moving "forward" (is braking).
Weaker force if vehicle is moving "backwards" (is reversing).

### Force: Lateral friction

Friction force,

$$
\begin{align}
F_{fric}
&= \mu \cdot s(\theta_{slip}) \nonumber \\
\end{align}
$$

where the slip function $s$ is

$$
s(\theta_{slip}) = 
\begin{cases}
\theta_{slip} \cdot p & \text{for} \quad \theta_{slip} \leq 3\degree \nonumber \\
p & \text{for} \quad \theta_{slip} \gt 3\degree \nonumber \\
\end{cases}
$$

and $p$ is the peak.

