Roller Chain Drive API
Roller-chain power-transmission maths as an API, computed locally and deterministically. The ratio endpoint computes a chain drive's speed ratio (driven ÷ driver teeth), the output rpm and torque multiplier, the chain (line) velocity v = N·p·rpm/60 and the pitch diameter of each sprocket, PD = p/sin(π/N), from the driver and driven tooth counts, the input speed and the chain pitch. The length endpoint computes the chain length in pitches and then rounds it up to an even number of links — links must come in pairs — using L = 2C/p + (N1+N2)/2 + ((N2−N1)/2π)²·p/C from the tooth counts, the centre distance and the pitch. The center-distance endpoint inverts that relation to give the exact centre distance for a chosen even link count, C = (p/8)·[(2L−N1−N2) + √((2L−N1−N2)² − 8·((N2−N1)/2π)²)]. Tooth counts are integers, pitch and centre distance in metres (the default pitch 0.0127 m is ANSI 40, ½ inch) and speeds in rpm. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical, machine-design, conveyor, motorcycle and industrial-equipment app developers, sprocket-sizing and chain-selection tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is industrial roller-chain drives; for bicycle gearing use a bike-gear API and for belt or gear ratios a gear-ratio API.
api.oanor.com/chain-api