Skip to content

Instantly share code, notes, and snippets.

@afahy
Last active April 9, 2018 07:12
Show Gist options
  • Save afahy/64e6360c078267df0277079f4bb188f7 to your computer and use it in GitHub Desktop.
Save afahy/64e6360c078267df0277079f4bb188f7 to your computer and use it in GitHub Desktop.
Calculate Wilks coefficient
/*
Calculate Wilks Coefficient to compare Powerlifting totals across bodyweights
https://en.wikipedia.org/wiki/Wilks_Coefficient
wilks(#body_weight, female?);
*/
const men = [
-216.0475144,
16.2606339,
-0.002388645,
-0.00113732,
7.01863E-06,
-1.291E-08
];
const women = [
594.31747775582,
-27.23842536447,
0.82112226871,
-0.00930733913,
0.00004731582,
-0.00000009054
];
const factor = (coeff, w) => (
coeff.reduce((p, c, i) => p + (c * Math.pow(w, i)))
);
const wilks = (weight, female) => {
return (500 / factor(female ? women : men, weight));
};
export default wilks;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment