https://github.com/runalyze/age-grade
Age grading for race results (running) based on tables provided by WMA
https://github.com/runalyze/age-grade
age-grade athletics running wma
Last synced: about 1 year ago
JSON representation
Age grading for race results (running) based on tables provided by WMA
- Host: GitHub
- URL: https://github.com/runalyze/age-grade
- Owner: Runalyze
- License: mit
- Created: 2016-10-02T17:10:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-11T14:30:06.000Z (over 2 years ago)
- Last Synced: 2024-10-20T23:14:44.279Z (over 1 year ago)
- Topics: age-grade, athletics, running, wma
- Language: PHP
- Size: 59.6 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Age Grade
[](https://packagist.org/packages/runalyze/age-grade)
[](https://travis-ci.org/Runalyze/age-grade)
[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
[](https://github.com/Runalyze/age-grade/blob/master/LICENSE)
Library to provide age grading for race results (running) based on tables provided by
[Alan Jones](http://www.runscore.com/Alan/AgeGrade.html) using standards by
WMA ([World Masters Athletics](http://www.world-masters-athletics.org/)) and
USATF ([USA Track and Field](http://www.usatf.org/)).
## Usage
```php
use Runalyze\AgeGrade\Lookup;
use Runalyze\AgeGrade\Table\MaleTable;
$Lookup = new Lookup(new MaleTable(), 54);
echo $Lookup->getAgeGrade(10.0, 42 * 60 + 25); // output: 0.7329
```
Internally, `getAgeGrade()` returns an `AgeGrade` object that will return the rounded age grade value when transformed to a string.
You can fetch more details by respective methods:
```php
$Lookup = new Lookup(new MaleTable(), 54);
$AgeGrade = $Lookup->getAgeGrade(10.0, 42 * 60 + 25);
$AgeGrade->getPerformance(); // returns 0.7329
$AgeGrade->getAgeStandard(); // returns 1865
$AgeGrade->getOpenStandard(); // returns 1603
$AgeGrade->getAgeFactor(); // returns 0.8594
```
## License
* Code released under [the MIT license](LICENSE).
* Tables are licensed under [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
* All Masters standards/factors are as approved by the WMA Vice President - Non Stadia, WMA President, and USATF MLDR Committee.