Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ever-balance/wilks-calculator
This library calculates performs calculations with the Wilks coefficient.
https://github.com/ever-balance/wilks-calculator
javascript npm npm-package powerlifting wilks
Last synced: 7 days ago
JSON representation
This library calculates performs calculations with the Wilks coefficient.
- Host: GitHub
- URL: https://github.com/ever-balance/wilks-calculator
- Owner: ever-balance
- License: mit
- Created: 2018-10-27T16:50:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T02:56:38.000Z (over 1 year ago)
- Last Synced: 2024-10-30T03:36:40.920Z (9 days ago)
- Topics: javascript, npm, npm-package, powerlifting, wilks
- Language: JavaScript
- Homepage:
- Size: 253 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wilks-calculator
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 qualification requirements for championships.[![Build Status](https://travis-ci.org/CaveMobster/wilks-calculator.svg?branch=master)](https://travis-ci.org/CaveMobster/wilks-calculator)
[![npm version](https://badge.fury.io/js/wilks-calculator.svg)](https://badge.fury.io/js/wilks-calculator)
[![Coverage Status](https://coveralls.io/repos/github/CaveMobster/wilks-calculator/badge.svg)](https://coveralls.io/github/CaveMobster/wilks-calculator)## Installation
`npm install wilks-calculator`
## Usage
`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)## Examples
### `calculateWilksScore`
```javascript
var femaleWilksScore = calculateWilksScore('f', 60, 300);
// Returns 334.47var maleWilksScore = calculateWilksScore('m', 90, 500);
// Returns 319.20var femaleImperialWilksScore = calculateWilksScore('f', 132, 660, 'imperial');
// Returns 334.31var maleImperialWilksScore = calculateWilksScore('m', 176, 882, 'imperial');
// Returns 273.49
```### `calculateWeightToLift`
```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)
```### `calculateNeededBodyWeight`
```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)
```## Tests
`npm test`