# Chain ring maths

The last three months I’ve been on parental leave. Nothing prepares someone for that. Maybe you think you’re gonna be doing something useful or fun or you finally get to read that book you’ve always been wanting to read. Well, nope. None of that. Most of your time is spent entertaining a nine-month old. Changing diapers, kissing boo-boos, making sure all power sockets remain unlicked. The works.
Of course we took the kiddo to all sorts of places, among other things we went to see Legoland, Kronborg and loads of trips to the deer park. It’s fun, but you’re always paying attention mostly to the baby. Always keep moving, keep cheering and entertain the twerp.

### The problem

Now that I’ve gone back to work, I’m riding my fixie again. Rather, it’s a single speed. I don’t see the appeal of fixed-gear biking, especially not in regular traffic and in this somewhat hilly terrain. Before I put it in moth balls, I noticed a few things that required some tweaking. First, the chain line is off. I used an old 50-34 compact crank set and the chain line would be perfectly straight if the chain was on the inner chain ring. Second, I can’t put the 50-tooth chain ring on the inside, since it would touch the frame. Thirdly, I’d like to put on a smaller chain ring to cope better with the aforementioned hills. My commute to work includes a climb of about 45 meters in height, and the steepest part is only 6 or 7 percent, that’s hard work with a 50/16 gear ratio.

### The maths

I measured the spacing with respect to the frame and I figure I can fit a chain ring on the inside that has a diameter less than about 10 cm. So all I gotta do now is figure out how big a chain ring is given the number of teeth. Turns out it’s possible to formulate this as a cool little geometry problem. To start with, we should realise that the teeth on a chain ring form a regular polygon. Just imagine tying bits of string to the tips of the teeth. Next, the distance between the teeth has to be fixed, otherwise the chain’s rollers wouldn’t fit in between. What I want to know, then, is the radius of the circumscribed circle of a regular $n$-sided polygon given that the side length is fixed. If the radius is less than 10 cm, I can fit it on my bike.

### The solution

One of the best things to start with in any maths problem is to try to draw a picture. It helps focus your thoughts and creates an intuitive understanding of the problem. This problem involves two-dimensional geometry, so a picture is actually an exact representation. Here’s a sketch of the situation (I know it’s rather poor, as these side lengths actually wouldn’t result in a regular polygon, but bear with me). Sketch of a regular polygon, the circumscribed circle and some quantities of interest.

Let’s start giving some names to things. Like in the sketch, I call $r$ the radius of the circle, with $a$ the distance between teeth and $\theta$ the angle between two teeth as measured from the centre. I furthermore call $n$ the number of teeth. As is hopefully clear from the sketch, the regular $n$-sided polygon can be carved up into $n$ isosceles triangles. These have legs with length $r$ and the bottom side is length $a$. To figure out the solution, it helps to focus on one isosceles triangle and bisect the angle $\theta$ to end up with a right-angle triangle.

Since we know what $\theta$ should be, as it comes from a regular $n$-sided polygon: $\theta = \frac{2 \pi}{n}$.

Now we’re almost done. It should be clear from the above sketch that the angle $\frac{\theta}{2}$ is related to $r$ and $\frac{a}{2}$ by a sine. $\sin \left( \frac{\pi}{n} \right) = \frac{a}{2 r}$.

This can be rearranged to express $r$, which is what I’m looking for. $r = \frac{a}{2 \sin \left( \frac{\pi}{n} \right)}$.

### Bolt circle diameter intermezzo

Incidentally, this expression also works for finding the bolt circle diameter (BCD), where you would measure $a$ and $n$ would be a small number like 4 or 5. Of course, to get the diameter instead of the radius, simply multiply by 2. To give an example, suppose you have a 5-bolt chain ring and you measure the distance between two adjacent bolts as 76.4 mm. Plugging this in, you would find a BCD of 130 mm.

### Back to chains and chain rings

Continuing on, $a$ is a funny constant that’s pretty much universal when it comes to bikes. For some reason a full link, which is a pair of inner and outer plates, is precisely an inch on a new chain. The distance between two rollers is therefore exactly half an inch. This is an interesting artefact left over from the modern bike being largely developed in the UK. There are more parts of a bike, strangely enough, which are still made with imperial measures. Wheels and tyre sizes are often indicated in inches.

Putting it all together, we find that the outer radius of a chain ring should be $r = \frac{ {1 / 4}^{\prime \prime}}{\sin ( \frac{\pi}{n})} = \frac{0.635 \,cm }{\sin ( \frac{\pi}{n})}$.

For a large number of teeth, this scales pretty much linearly with the number of teeth, meaning $r \approx 0.635 \,cm \cdot \frac{n}{\pi}$.

This makes sense, since the polygon has more and more sides and starts behaving more like a circle. There’s a nice intuitive way to think about this, as we have a circle of circumference $2 \pi r$ and we’re trying to fit $n$ teeth together so that $n \cdot a$ fits around the circle. Equating the two and solving for $r$ yields the approximation. So it also makes sense geometrically. The approximation is so good that the relative difference is already less than a percent for about 13 teeth onwards. In the range I’m thinking about, say 44 to 48 teeth, the approximation is off by less than a millimetre.

### How many teeth?

Since the approximation is so good, we can use it to figure out how big of a chain ring would fit on my bike. Just set $r$ to 10 cm and solve for $n$, which yields $n = \pi \frac{10}{0.635} = 49.47$.

However, only an integer number of teeth are allowed, of course, so a 49-tooth chain ring would fit. Or anything smaller. My idea is to install a 46-tooth chain ring, which would easily fall in the margin with a 9.3 cm radius. It would be about 8% lighter to pedal. Hopefully, I won’t sacrifice too much speed on the flat, while getting up that nasty little hill a bit easier.