Department of Physics and Astronomy

The Forbes Group

Parking and Commutation

$\newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\uvect}[1]{\hat{#1}} \newcommand{\abs}[1]{\lvert#1\rvert} \newcommand{\norm}[1]{\lVert#1\rVert} \newcommand{\I}{\mathrm{i}} \newcommand{\ket}[1]{\left|#1\right\rangle} \newcommand{\bra}[1]{\left\langle#1\right|} \newcommand{\braket}[1]{\langle#1\rangle} \newcommand{\op}[1]{\mathbf{#1}} \newcommand{\mat}[1]{\mathbf{#1}} \newcommand{\d}{\mathrm{d}} \newcommand{\pdiff}[3][]{\frac{\partial^{#1} #2}{\partial {#3}^{#1}}} \newcommand{\diff}[3][]{\frac{\d^{#1} #2}{\d {#3}^{#1}}} \newcommand{\ddiff}[3][]{\frac{\delta^{#1} #2}{\delta {#3}^{#1}}} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\order}{O} \DeclareMathOperator{\diag}{diag} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\sech}{sech} $

The process of driving and parking can be described using the mathematics of non-commutative algebra which gives some interesting insight into the difficulty of parallel parking. This discussion is motivated and follows a similar discussion from William Burke's book Applied Differential Geometry.

Mathematical Formulation

Unique and Complete

Consider the motion of a car on a flat plane. To mathematically formulate the problem, we must provide a unique and unambigious characterization of the state of the car. This can be done in a four-dimensional configuration space with the following four quantities:

  • $(x, y)$: The position of the car can be described by two numbers to locate where the car is in the plane. Note: to be precise we must specify which point on the car lies at this position, and the algebra might be simplified if we are careful about the placement. As a guess, we start by taking this to be the midpoint of the front axle of the car. In this way, the point $(x, y)$ will move in the direction of the front wheels when driving.
  • $\phi$: The orientation of the car. This angle will denote the direction in which the car points.
  • $\theta$: The orientation of the steering wheels. This will be relative to the car so that $\theta=0$ means the wheels point straight ahead.

Stop and think for a moment: is this complete? Can we describe every possible position of a car with a set of these four quantities? The answer is definitely no as the following diagram indicates:

but with an appropriate restriction placed on the possible condition of the car, you should be able to convince yourself that such a choice of four coordinates is indeed sufficient for our purposes. (If we wish to consider the dynamics of the car, we will need additionally the velocity, and angular velocity, but here we shall just consider the geometric motion of the car.)

The second question you should ask is: "Is such a characterization unique?" Here again the answer is no: $\theta = 0°$ and $\theta = 360°$ correspond to the same configuration. Thus, we need to restrict our angular variables to lie between $-180° \leq \theta,\phi < 180°$ for example. With such a restriction, our characterization is both unique and complete, and thus a suitable mathematical formulation of the problem.

Units

To simplify the mathematics, we further restrict our notation so that $x$ and $y$ are specified in meters, while $\theta$ and $\phi$ are specified in radians. In this way, the configuration of the car can be specified by four pure numbers $(x, y, \theta, \phi)$.

Driving

Driving consists of applying two operations to the car which we shall call drive and steer. Mathematically we represent these as operators $\op{D}_s$ and $\op{S}_\theta$ respectively as following:

  • $\op{D}_s$ means drive forward (keeping the steering wheel fixed) for distance $s$.
  • $\op{S}_\theta$ means rotate the steering wheel through angle $\theta$.

Steering

Steering is the easiest operation to analyze. Given a state $(x_1, y_1, \theta_1, \phi_1)$, steering takes this to the state $\op{S}_{\theta}(x_1, y_1, \theta_1, \phi_1) = (x_1, y_1, \theta_1+\theta, \phi_1)$. In words: steering changes the direction of the steering wheel, but does not change the position of orientation of the car. Mathematically this operation is a translation, but as we shall see later, it is convenient to represent these operations as matrices. Thus, we add one extra component to our vectors which is fixed:

$$ \vect{p}_1 = \begin{pmatrix} x_1\\ y_1\\ \theta_1\\ \phi_1\\ 1 \end{pmatrix} $$

This same trick is often used in computer graphics to allow both rotations and translations to be represented by matrices. With this concrete representation of configurations as a five-dimensional vector who's last component is always $1$, we can thus represent $\op{S}_{\theta}$ as a matrix:

$$ \vect{p}_2 = \mat{S}_{\theta}\cdot\vect{p}_{1}, \qquad \begin{pmatrix} x_1\\y_1\\ \theta_1 + \theta \\ \phi_1\\ 1 \end{pmatrix} = \mat{S}_{\theta} \cdot \begin{pmatrix} x_1\\y_1\\ \theta_1 \\ \phi_1\\ 1 \end{pmatrix},\qquad \mat{S}_{\theta} = \begin{pmatrix} 1\\ & 1\\ && 1 &&\theta\\ &&& 1\\ &&&& 1 \end{pmatrix} $$

Motion

Motion of the car is obtained by applying the drive operator, but this is somewhat more difficult to describe. To specify this, we must work out the geometry of the car. In particular, the motion of the car when $\theta \neq 0$ will depend on the length of the car $L$, or more specifically, the distance between the back and front axles. Without loss of generality (w.l.o.g.), we can assume $L=1$m. (To discuss the motion of longer or shorter cars, we can simply change our units so that the numbers $x$ and $y$ specify the position in units of the length $L$).

To deduce the behaviour, use two vectors $\vect{f}$ and $\vect{b}$ which point to the center of front and back axles respectively. Cars generally have fixed length, so that $\norm{\vect{f} - \vect{b}} = L$ remains fixed. Now, if the car moves forward, then $\vect{b}$ moves in the direction of $\vect{f} - \vect{b}$ while $\vect{f}$ moves in the direction of the steering wheel.

A Better Representation

Polar coordinates are extremely useful for representing vectors in the $x$-$y$ plane. In particular, the representation as a complex number $z = x + \I y = re^{\I\phi}$. Here we suggest a more practical (though less intuitive) representation of the problem in terms of the complex number $z$ describing the position of the car, and the phases $e^{\I\theta}$ for the orientation of the car, and $e^{\I\varphi}$ for the orientation of the steering wheel:

$$ \vect{p} = \begin{pmatrix} re^{\I\phi}\\ e^{\I\theta}\\ e^{\I\varphi} \end{pmatrix} $$

We can now work out how the car moves while driving from the following argument. Let $f=z$ be the center of the front axle and $b$ be the center of the back axle. These satisfy the following relationship where $L$ is the length of the axle and $\theta$ is the orientation of the car:

$$ f - b = L e^{\I\theta}. $$

While driving, the length of the car must not change, the front axle $f$ must move in the direction of the wheels $e^{\I(\theta + \varphi)}$ while the back axle $b$ must move towards the front axle $e^{\I\theta}$. The infinitesimal motion of the car thus satisfies:

$$ \d{f} = e^{\I(\theta + \varphi)}\d{s}, \qquad \d{b} = ae^{\I\theta}\d{s}, \qquad \d{f}-\d{b} = e^{\I\theta}(e^{\I\varphi}-a)\d{s} = Le^{\I\theta}\I\d{\theta}. $$

We must adjust the coefficient $a$ so that the car does not change length, which is equivalent to the condition that $(e^{\I\varphi}-a)\d{s} = (\cos\varphi-a + \I\sin\varphi)\d{s} = \I L\d{\theta}$. Hence, after equating real and imaginary portions:

$$ a = \cos\varphi, \qquad \d{\theta} = \d{s}\sin\varphi/L. $$

The second condition tells us how fast the car rotates. We now have the complete infinitesimal forms for steering and driving:

$$ \d{\op{S}_{\alpha}(\vect{p})} = \begin{pmatrix} 0\\ 0\\ \I e^{\I\varphi}\\ \end{pmatrix} \d{\alpha}, \qquad \d{\op{D}_{s}(\vect{p})} = \begin{pmatrix} e^{\I(\theta + \varphi)}\\ \frac{\I\sin\varphi}{L}e^{\I\theta}\\ 0\\ \end{pmatrix} \d{s}. $$

In terms of the complex numbers where $z=re^{\I\phi}$ we can write these as derivatives:

$$ \op{s} = \pdiff{}{\varphi}, \qquad \op{d} = e^{\I(\theta + \varphi)}\pdiff{}{z} + \frac{\sin\varphi}{L}\pdiff{}{\theta}. $$

Now we can compute the commutator of these operators:

$$ [\op{s}, \op{d}]p = \op{s}\left( e^{\I(\theta+\varphi)}p_{,z} + \frac{\sin\varphi}{L}p_{,\theta} \right) - \op{d}(p_{,\varphi})\\ = \left( \I e^{\I(\theta+\varphi)}p_{,z} + e^{\I(\theta+\varphi)}p_{,z\varphi} + \frac{\cos\varphi}{L}p_{,\theta} + \frac{\sin\varphi}{L}p_{,\theta\varphi} \right) - \left(e^{\I(\theta+\varphi)}p_{,\varphi z} + \frac{\sin\varphi}{L}p_{,\varphi \theta})\right)\\ = \I e^{\I(\theta+\varphi)}p_{,z} + \frac{\cos\varphi}{L}p_{,\theta} = \left(\I e^{\I(\theta+\varphi)}\pdiff{}{z} + \frac{\cos\varphi}{L}\pdiff{}{\theta}\right)p. $$

This is a combination of a rotation and a translation which one can decompose into a pure rotation about some point (Exercise: find the point.)

We now complete the same procedure using the point $b$ as a reference point.

$$ \d{\op{S}_{\alpha}(\vect{p})} = \begin{pmatrix} 0\\ 0\\ \I e^{\I\varphi}\\ \end{pmatrix} \d{\alpha}, \qquad \d{\op{D}_{s}(\vect{p})} = \begin{pmatrix} \cos\varphi e^{\I\theta}\\ \frac{\I\sin\varphi}{L}e^{\I\theta}\\ 0\\ \end{pmatrix} \d{s}. $$$$ \op{s} = \pdiff{}{\varphi}, \qquad \op{d} = \cos\varphi e^{\I\theta}\pdiff{}{z} + \frac{\sin\varphi}{L}\pdiff{}{\theta}. $$$$ [\op{s}, \op{d}]p = \op{s}\left( \cos\varphi e^{\I\theta}p_{,z} + \frac{\sin\varphi}{L}p_{,\theta} \right) - \op{d}(p_{,\varphi})\\ = \left( -\I \sin\varphi e^{\I\theta}p_{,z} + \cos\varphi e^{\I\theta}p_{,z\varphi} + \frac{\cos\varphi}{L}p_{,\theta} + \frac{\sin\varphi}{L}p_{,\theta\varphi} \right) - \left(\cos\varphi e^{\I\theta}p_{,\varphi z} + \frac{\sin\varphi}{L}p_{,\varphi \theta})\right)\\ = -\I \sin \varphi e^{\I\theta}p_{,z} + \frac{\cos\varphi}{L}p_{,\theta}\\ = \left(-\I \sin\varphi e^{\I\theta}\pdiff{}{z} + \frac{\cos\varphi}{L}\pdiff{}{\theta}\right)p. $$

In this case, we see that if we execute this commutator about $\varphi = 0$, then we indeed rotate the car about the center of the back axle without any translation.