The Mechanics of Billiards




In the next post we are going to develop an AI which can play pool against an opponent; in order to do that, we first need to establish the mathematics of pool. This post will lay out the physics of billiard balls in as simple of a way as possible. There will be no code in this post. For simplicity, we will focus only on two pool balls colliding elastically without the presence of friction – a realistic enough scenario for any game.

Since our pool balls are confined to move along the plane of the table (i.e. they aren’t floating through the air), they have freedom to move in two dimensions. In addition, we have the good fortune that the balls are the same mass, which simplifies some calculations.

Let’s say that before the collision Ball 1 is moving with some velocity \vec{ v }_{1}, while Ball 2 is moving with some velocity \vec{ v }_{2}. These velocities can point anywhere in the plane of the table. In addition, immediately before the collision let’s label a vector \vec{d} which points from the center of Ball 1 to the center of Ball 2.

After the collision, Ball 1 has velocity \vec{u}_{1} and Ball 2 has velocity \vec{u}_{2}. Since the balls have not yet moved immediately after the collision, the same vector \vec{d} points from the center of Ball 1 to the center of Ball 2.

The first thing we will do, to simplify our equations, is move to a special reference frame where one of the balls (we will pick Ball 2) is initially at rest. This means that we are pretending that we are moving alongside Ball 2 so that it appears at rest with respect to us; in practice, this is equivalent to making the following substitution for the velocities:

    \[ \vec{w}_{1} = \vec{v}_{1} - \vec{v}_{2}  \]

    \[ \vec{w}_{2} = 0 \]

    \[ \vec{s}_{1} = \vec{u}_{1} - \vec{v}_{2} \]

    \[ \vec{s}_{2} = \vec{u}_{2} - \vec{v}_{2} \]

Here the \vec{w} vectors represent the balls before the collision, and the \vec{s} vectors represent the balls after the collision. Note that all of the laws of physics we are used to are still upheld in this frame of reference, and we can switch back to our \vec{v} and \vec{u} values after the dust settles.

From conservation of angular momentum we have

    \[ m \vec{w}_{1} + 0 = m \vec{s}_{1} + m \vec{s}_{2} \]

which can be rearranged as

    \[ \vec{s}_{1} = \vec{w}_{1} - \vec{s}_{2} \]

Next we apply conservation of kinetic energy (we are presuming an elastic collision) to get

    \[ \frac{1}{2} m w_{1}^{2} + 0 = \frac{1}{2} m s_{1}^{2} + \frac{1}{2} m s_{2}^{2} \]

which can be rearranged to get

    \[ s_{1}^{2} = w_{1}^{2} - s_{2}^{2} \]

    \[ \vec{s}_{1} \cdot \vec{s}_{1} = \vec{w}_{1} \cdot \vec{w}_{1} - \vec{s}_{2} \cdot \vec{s}_{2} \]

Substituting our previous expression for \vec{s}_{1}, we have

    \[ \left(\vec{w}_{1} - \vec{s}_{2} \right) \cdot \left(\vec{w}_{1} - \vec{s}_{2} \right) = \vec{w}_{1} \cdot \vec{w}_{1} - \vec{s}_{2} \cdot \vec{s}_{2} \]

    \[ \vec{w}_{1} \cdot \vec{w}_{1} - 2 \vec{w}_{1} \cdot \vec{s}_{2} + \vec{s}_{2} \cdot \vec{s}_{2} = \vec{w}_{1} \cdot \vec{w}_{1} - \vec{s}_{2} \cdot \vec{s}_{2} \]

    \[ \vec{w}_{1} \cdot \vec{s}_{2} - \vec{s}_{2} \cdot \vec{s}_{2} = 0 \]

    \[ \vec{s}_{2} \cdot \left( \vec{w}_{1} - \vec{s}_{2} \right) = 0 \]

Hence  \vec{w}_{1} - \vec{s}_{2} is perpendicular to  \vec{s}_{2}. So far we have used three conservation equations (two components of momentum and one component of kinetic energy), but we have four components to solve for. Thus to uniquely solve for them, we need a fourth conservation equation. For this we will use conservation of angular momentum.

To simplify as much as possible, we will choose our axis of rotation to be perpendicular to the plane of the table and passing through the center of Ball 1. We will ignore the spin of the ball and will instead represent angular momentum by the expression m \vec{v} \times \vec{r}, where \vec{v} is the velocity of the ball in question and \vec{r} is the displacement vector from the ball to the axis of rotation. Since Ball 1 is located on the axis of rotation, \vec{r} is zero for Ball 1 both before and after the collision; hence its angular momentum is zero in both cases. Likewise, in our reference frame Ball 2 is initially at rest – hence its angular momentum is also zero before the collision. Thus there is only one angular momentum term, which is from Ball 2 after the collision:

    \[ 0 + 0 = 0 + m \vec{s}_{2} \times \vec{d} \]

    \[ \vec{s}_{2} \times \vec{d} = 0 \]

This implies that \vec{s}_{2} is parallel to the vector \vec{d} which points from the center of Ball 1 to the center of Ball 2. (It could also be antiparallel mathematically, but this would be an unphysical solution in which Ball 2 would pass through Ball 1. This sort of solution occurs due to the quadratic terms in the kinetic energy, which have two roots.)

Before we continue, we should make an important note that will be of great use when making our AI in the next post: if Ball 2 is initially at rest (which is the reference frame we are dealing with here), then after the collision Ball 2 will move in the direction of the displacement vector \vec{d} which points from the center of Ball 1 to the center of Ball 2.

Earlier, we proved that  \vec{w}_{1} - \vec{s}_{2} is perpendicular to  \vec{s}_{2}. Since we have now proved that  \vec{s}_{2} is parallel with \vec{d}, it follows that  \vec{w}_{1} - \vec{s}_{2} is perpendicular to \vec{d}. Hence their dot product must be zero:

    \[ \vec{d} \cdot \left( \vec{w}_{1} - \vec{s}_{2} \right) = 0 \]

    \[ \vec{s}_{2} \cdot \vec{d} = \vec{w}_{1} \cdot \vec{d} \]

Since  \vec{s}_{2} is parallel with \vec{d}, it follows that  \vec{s}_{2} \cdot \vec{d} = s_{2} d:

    \[ s_{2} d = \vec{w}_{1} \cdot \vec{d} \]

    \[ s_{2} = \frac{1}{d} \vec{w}_{1} \cdot \vec{d} \]

We also can easily see that \vec{s}_{2} = \frac{s_{2}}{d} \vec{d}. Summing all of our results, the following equations completely determine the velocities of the balls after the collision:

    \[ \vec{w}_1 = \vec{v}_1 - \vec{v}_2  \]

    \[ s_{2} = \frac{1}{d} \vec{w}_{1} \cdot \vec{d} \]

    \[ \vec{s}_{2} = \frac{s_{2}}{d} \vec{d} \]

    \[ \vec{s}_{1} = \vec{w}_{1} - \vec{s}_{2} \]

    \[ \vec{u}_{1} = \vec{s}_{1} + \vec{v}_{2} \]

    \[ \vec{u}_{2} = \vec{s}_{2} + \vec{v}_{2} \]

In case you have forgotten our conventions, the \vec{v} vectors are the velocities of the balls before the collisions, the \vec{u} vectors are the velocities of the balls after the collisions, and \vec{d} is the displacement vector which separates their centers before the collision.

Games Mentioned in this Post:

Pool Champions

1 thought on “The Mechanics of Billiards”

Leave a Reply

Your email address will not be published. Required fields are marked *