Marathon not correct
Opened this issue · 13 comments
Were you ever able to fix this issue? You have a todo that says this calculation is not correct.
/**
* Calculate marathon pace paces based on VDOT
*
* @todo this calculation is not correct
*
* @return integer
*/
function marathon()
{
return round((($this->easy() - $this->tempo()) * 2/3) + $this->tempo(), 2); // 2/3 from Easy to Tempo.
}
I do not quite remember what the problem was, as the test here
https://github.com/lsolesen/running-calculations/blob/master/tests/Running/PaceTest.php#L18
seems to pass. Maybe it is a forgotten @todo. I will investigate soon.
The code referenced is from here:
https://github.com/lsolesen/running-calculations/blob/master/src/Running/Vdot/Pace.php#L49
It seems strange though, that only that function is not wrapped in
this->km()
So if you run marathon off a given vdot. the output number doesnt come close to the jack daniels vdot calculator. https://runsmartproject.com/calculator/
Cause i also though "oh maybe he just forgot to remove the todo"
I am pretty sure that all the tests for the Paces needs updating. Pull requests welcome :)
I would have not problem updating the paces. I just dont know where to get the formula from.
If you improve the tests, I will help figure it out.
In this instance tests are somewhat arbitrary considering jack daniels calculator gives a range. Im satisfied as long it is as close as possible. The only one that isnt close is that marathon.
oki. what should the value be?
did you get a change to look at this website? https://runsmartproject.com/calculator/
Yeah, I use it all the time. :)
ok if you do a marathon comparison between that site and an output from your class you can see that its off by a good amount.
Actually it seems that all of the values are off. Pretty sure I just based the tests off the results of the methods from the assumption that they were calculating correctly.