Skip to content

markgeyer/crankarmlength

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crank Arm Length Calculator

A Next.js site that synthesises six published crank-length formulas, adjusts the result for how the rider actually rides, visualises the formula disagreement, and points at the retailers where non-standard lengths can actually be bought.

Prerequisites

  • Node.js 18.17+ (tested on 25.x)
  • npm 9+

Install

npm install

Run locally

npm run dev

Dev server at http://localhost:3000, hot reload enabled.

Production build

npm run build
npm start

Project layout

app/
  Calculator.tsx         client component — inputs, recommendation card
  formulas.ts            pure-function formula module + synthesis
  data.ts                static content: retailers, FAQ
  layout.tsx             root HTML shell + metadata
  page.tsx               composes all sections
  globals.css            all styles
  components/
    Visualization.tsx    SVG number-line plot of all 6 results
    WhyItMatters.tsx     biomechanics + pedal-stroke diagram
    BuyingGuide.tsx      retailers + pre-purchase checklist
    Faq.tsx              expandable FAQ
public/                  favicon + icons
legacy/                  original AngularJS 1.x static site, kept for reference

How the recommendation works

  1. Six formulas run on (heightCm, inseamCm) — see the table below.
  2. Each rider-context selection (terrain, style, flexibility, knees) adds a small mm offset to every formula's raw output.
  3. The offset-adjusted raw values are snapped to the nearest standard production crank length: 150, 155, 160, 162.5, 165, 167.5, 170, 172.5, 175, 177.5, 180, 185 mm.
  4. The synthesis drops the highest and lowest of the six (cutting Kirby-Palm-high / Obree-low outliers) and snaps the trimmed mean. Confidence is reported based on spread: ≤5 mm = high, ≤10 mm = medium, >10 mm = low.

The formulas

Formula Input Method
Bike Manufacturers height Step function: 5 height bins → 165 / 170 / 172.5 / 175 / 177.5 mm
Bike Dynamics inseam Linear fit to their chart: 0.5 × inseam_cm + 130
Machinehead inseam 1.25 × inseam_cm + 65
Graham Obree height 0.95 × height_cm (9.5 % of height in mm)
Spécialités TA inseam Step function from TA's chart (10 bands, 150–185 mm)
Kirby Palm inseam 2.16 × inseam_cm

Rider-context offsets

Input Option Offset
Terrain Flat / Hills / Mountains −2.5 / 0 / +2.5 mm (averaged if multiple)
Style TT or Track −2.5 mm
Style MTB +2.5 mm
Style Road / Gravel / Commute 0 mm
Flexibility Limited −2.5 mm
Knee history Mild −2.5 mm
Knee history Significant −5 mm

Sources

About

Calculate your optimal bicycle crank arm length based on your body geometry and how you ride.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors