### Bike trig: distance b/w sprockets connected by a chain

Posted:

**Sat Jan 01, 2011 11:52 am UTC**I'm trying to build an application to perform some various calculations relating to bicycle gearing, and there's one problem I'm stuck on - how to calculate the distance between the rear wheel axle and the crankset/bottom bracket axle for a chain of known length and sprockets of known size. (It is possible on some bikes to adjust the position of the rear axle.)

Firstly, a little nomenclature and background:

- The distance between the two axles is often called the "chainstay length", named after the structural members running between the them.

- The rear sprocket is normally called "sprocket" and the front one is called "chainring".

- Sprockets and chainrings are measured by the number of teeth they possess, and their circumference (where the chain rests) can easily be calculated by multiplying the number of teeth by the chain pitch (which is almost always a half inch).

Here's the maths I've done so far (including a diagram showing the problem), which can be used to calculate the chain length given the size of the sprocket and chainring, and the distance between their centres.

Now, when it comes to calculating the distance between the axles from the length of the chain, it gets a bit tricky. I don't know of any way to rearrange the above (spoilered) equation to form a function for l

Actually, after writing this, I've just realised that it can be simplified a little, using the following:

Thanks! (Also, INB4 homework. It isn't.)

Firstly, a little nomenclature and background:

- The distance between the two axles is often called the "chainstay length", named after the structural members running between the them.

- The rear sprocket is normally called "sprocket" and the front one is called "chainring".

- Sprockets and chainrings are measured by the number of teeth they possess, and their circumference (where the chain rests) can easily be calculated by multiplying the number of teeth by the chain pitch (which is almost always a half inch).

Here's the maths I've done so far (including a diagram showing the problem), which can be used to calculate the chain length given the size of the sprocket and chainring, and the distance between their centres.

**Spoiler:**

Now, when it comes to calculating the distance between the axles from the length of the chain, it gets a bit tricky. I don't know of any way to rearrange the above (spoilered) equation to form a function for l

_{cs}, and I can see any other way to solve it from the diagram. I'm tempted to just do it numerically, obtaining a starting point by assuming α_{s}and α_{c}to both be 90°, simplifying the problem to just subtracting a couple of half circumferences and (twice) a Pythagorean calculation, then iteratively feeding this approximate value into the formula above and adjusting based on how the result deviates from the expected chain length. However, if anyone has any other ideas, I'd be very interested to hear them.Actually, after writing this, I've just realised that it can be simplified a little, using the following:

**Spoiler:**

Thanks! (Also, INB4 homework. It isn't.)