wilks-calculator
Version:
This library calculates performs calculations with the Wilks coefficient, which is a coefficient used by the International Powerlifting Federation to determine the relative strength of competitors. They also use this coefficient for determining the qual
98 lines (68 loc) • 3 kB
Markdown
with the Wilks coefficient, which is a coefficient
used by the International Powerlifting Federation to determine the relative strength of competitors.
They also use this coefficient for determining the qualification requirements for championships.
[](https://travis-ci.org/CaveMobster/wilks-calculator)
[](https://badge.fury.io/js/wilks-calculator)
[](https://coveralls.io/github/CaveMobster/wilks-calculator)
`npm install wilks-calculator`
`const wilksCalculator = require('wilks-calculator')`
```javascript
wilksCalculator.calculateWilksScore(gender, bodyWeight, liftedWeight, [unitType]);
```
* `gender (string)` - 'm' for Male and 'f' for Female
* `bodyWeight (number)`
* `liftedWeight (number)`
* `unitType (string)` - 'metric' or 'imperial' (optional)
```javascript
wilksCalculator.calculateWeightToLift(gender, bodyWeight, wilksScore, [unitType]);
```
* `gender (string)` - 'm' for Male and 'f' for Female
* `bodyWeight (number)`
* `wilksScore (number)`
* `unitType (string)` - 'metric' or 'imperial' (optional)
```javascript
wilksCalculator.calculateNeededBodyWeight(gender, liftedWeight, wilksScore, [unitType]);
```
* `gender (string)` - 'm' for Male and 'f' for Female
* `liftedWeight (number)`
* `wilksScore (number)`
* `unitType (string)` - 'metric' or 'imperial' (optional)
```javascript
var femaleWilksScore = calculateWilksScore('f', 60, 300);
// Returns 334.47
var maleWilksScore = calculateWilksScore('m', 90, 500);
// Returns 319.20
var femaleImperialWilksScore = calculateWilksScore('f', 132, 660, 'imperial');
// Returns 334.31
var maleImperialWilksScore = calculateWilksScore('m', 176, 882, 'imperial');
// Returns 273.49
```
```javascript
var femaleTotal = calculateWeightToLift('f', 60, 350);
// Returns 313.93 (kg)
var maleTotal = calculateWeightToLift('m', 80, 350);
// Returns 512.67 (kg)
var femaleImperialTotal = calculateWeightToLift('f', 132, 660, 'imperial');
// Returns 690.97 (lbs)
var maleImperialTotal = calculateWeightToLift('m', 176, 350, 'imperial');
// Returns 1128.74 (lbs)
```
```javascript
var femaleBodyWeight = calculateNeededBodyWeight('f', 300, 350);
// Returns 56.6 (kg)
var maleBodyWeight = calculateNeededBodyWeight('m', 600, 350);
// Returns 113.2 (kg)
var femaleImperialBodyWeight = calculateNeededBodyWeight('f', 690, 660, 'imperial');
// Returns 131.62 (lbs)
var maleImperialBodyWeight = calculateNeededBodyWeight('m', 1128, 350, 'imperial');
// Returns 175.70 (lbs)
```
`npm test`
This library calculates performs calculations