## Steering your car

Calculating the turn radius of a car is not so difficult. All the
information we need is in the diagram. The radius of the turn is marked
with **R** and there are only two factors that influence
it. These are the steering angle of the front wheels and the wheelbase
of the car.

From our everyday experience we all know that the more we turn the steering wheel the harder the car turns. The other factor, the wheelbase, is not so obvious, because we usually overcome its consequences with the steering wheel. Nevertheless we all know that smaller cars are more agile in confined spaces. This is because they have shorter wheelbase.

From Euclidian geometry we know that the steering angle (δ) is the same as the angle at the center of the turn marked with the same letter, (their respective sides are perpendicular). Now from elementary trigonometry we know that

sin(δ) = Wb / R (1)

where **Wb** is the wheelbase of the car and **
R** is the radius of the turn.

When you turn the steering wheel the car starts moving on a circle. The distance covered is still determined by the speed and the time interval. Only this time the final position is slightly to the right or left, and your heading has changed accordingly. In order to determine the resulting position and heading we have to find the angular velocity of the car. This is given by the formula

ω = v / R (2)

Where **ω** is the symbol used for the angular
velocity,
**v** is the linear velocity and **R** is
the turn radius.

If we are driving at low speed, or we assume infinite grip these equations are all we need to calculate the position and heading of our car. In real world the tyres start to slip as the speed increases and the car might slide to the side. The final movement is much more complicated and beyond the scope of this article.

For the purpose of this article I have created a little application to demonstrate the behavior of the steering wheels. If you refer to the simple application tutorial you will notice that the two samples are almost the same. This is true. The only change I had to make was to remove the direct modification of the direction angle and calculate it using the equations given in this article.

You will notice that the code needed to make the imaginary car move in a realistic manner is very little. How much code do you need anyway for the two equations above?