|
1 |
| -# Age Grade |
2 |
| - |
3 |
| -[](https://packagist.org/packages/runalyze/age-grade) |
4 |
| -[](https://travis-ci.org/Runalyze/age-grade) |
5 |
| -[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master) |
6 |
| -[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master) |
7 |
| -[](https://github.com/Runalyze/age-grade/blob/master/LICENSE) |
8 |
| - |
9 |
| -Library to provide age grading for race results (running) based on tables provided by |
10 |
| -[Alan Jones](http://www.runscore.com/Alan/AgeGrade.html) using standards by |
11 |
| -WMA ([World Masters Athletics](http://www.world-masters-athletics.org/)) and |
12 |
| -USATF ([USA Track and Field](http://www.usatf.org/)). |
13 |
| - |
14 |
| -## Usage |
15 |
| - |
16 |
| -```php |
17 |
| -use Runalyze\AgeGrade\Lookup; |
18 |
| -use Runalyze\AgeGrade\Table\MaleTable; |
19 |
| - |
20 |
| -$Lookup = new Lookup(new MaleTable(), 54); |
21 |
| -echo $Lookup->getAgeGrade(10.0, 42 * 60 + 25); // output: 0.7329 |
22 |
| -``` |
23 |
| - |
24 |
| -Internally, `getAgeGrade()` returns an `AgeGrade` object that will return the rounded age grade value when transformed to a string. |
25 |
| -You can fetch more details by respective methods: |
26 |
| - |
27 |
| -```php |
28 |
| -$Lookup = new Lookup(new MaleTable(), 54); |
29 |
| -$AgeGrade = $Lookup->getAgeGrade(10.0, 42 * 60 + 25); |
30 |
| -$AgeGrade->getPerformance(); // returns 0.7329 |
31 |
| -$AgeGrade->getAgeStandard(); // returns 1865 |
32 |
| -$AgeGrade->getOpenStandard(); // returns 1603 |
33 |
| -$AgeGrade->getAgeFactor(); // returns 0.8594 |
34 |
| -``` |
35 |
| - |
36 |
| -## License |
37 |
| - |
38 |
| - * Code released under [the MIT license](LICENSE). |
39 |
| - * Tables are licensed under [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). |
40 |
| - * All Masters standards/factors are as approved by the WMA Vice President - Non Stadia, WMA President, and USATF MLDR Committee. |
| 1 | +# Age Grade |
| 2 | + |
| 3 | +[](https://packagist.org/packages/runalyze/age-grade) |
| 4 | +[](https://travis-ci.org/Runalyze/age-grade) |
| 5 | +[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master) |
| 6 | +[](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master) |
| 7 | +[](https://github.com/Runalyze/age-grade/blob/master/LICENSE) |
| 8 | + |
| 9 | +Library to provide age grading for race results (running) based on tables provided by |
| 10 | +[Alan Jones](http://www.runscore.com/Alan/AgeGrade.html) using standards by |
| 11 | +WMA ([World Masters Athletics](http://www.world-masters-athletics.org/)) and |
| 12 | +USATF ([USA Track and Field](http://www.usatf.org/)). |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +```php |
| 17 | +use Runalyze\AgeGrade\Lookup; |
| 18 | +use Runalyze\AgeGrade\Table\MaleTable; |
| 19 | + |
| 20 | +$Lookup = new Lookup(new MaleTable(), 54); |
| 21 | +echo $Lookup->getAgeGrade(10.0, 42 * 60 + 25); // output: 0.7329 |
| 22 | +``` |
| 23 | + |
| 24 | +Internally, `getAgeGrade()` returns an `AgeGrade` object that will return the rounded age grade value when transformed to a string. |
| 25 | +You can fetch more details by respective methods: |
| 26 | + |
| 27 | +```php |
| 28 | +$Lookup = new Lookup(new MaleTable(), 54); |
| 29 | +$AgeGrade = $Lookup->getAgeGrade(10.0, 42 * 60 + 25); |
| 30 | +$AgeGrade->getPerformance(); // returns 0.7329 |
| 31 | +$AgeGrade->getAgeStandard(); // returns 1865 |
| 32 | +$AgeGrade->getOpenStandard(); // returns 1603 |
| 33 | +$AgeGrade->getAgeFactor(); // returns 0.8594 |
| 34 | +``` |
| 35 | + |
| 36 | +## License |
| 37 | + |
| 38 | + * Code released under [the MIT license](LICENSE). |
| 39 | + * Tables are licensed under [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). |
| 40 | + * All Masters standards/factors are as approved by the WMA Vice President - Non Stadia, WMA President, and USATF MLDR Committee. |
0 commit comments