Skip to content

Instantly share code, notes, and snippets.

View thomasvst's full-sized avatar

Thomas thomasvst

  • Belgium
View GitHub Profile
@thomasvst
thomasvst / SpokeLengthUtils.js
Last active December 7, 2023 14:58
Collection of utility funtions around spoke length calculation in Javascript. Written by Thomas @ LH WHEELS (https://www.lhwheels.be/)
/**
* Compute the spoke length for one side of the wheel, based on the standard spoke length formula.
*
* Sample : spokeLength(593, 110, 2.5, 57.9, 26.8, 32, 3);
*
* @param erd the Effective Rim Diameter (ERD)
* @param spokeHoleDiameter the hub spoke hole dimater, in mm (usually 2.6)
* @param hubFlangeDiameter the diameter of the hub flange (from hole to hole) in mm
* @param hubFlangeToCenter the distante between the hub flange and the wheel center, taking the rim offset into account, in mm
* @param numberOfSpokes the total number of spoke used to buid the wheel (24, 28, 32)
<!DOCTYPE html>
<html ng-app="myApp" ng-controller="myCtrl">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
[rotate-on-click] {
height: 50px;
width: 50px;