promash/calc.php

11 lines
239 B
PHP
Raw Normal View History

2014-03-07 18:45:30 +00:00
<?php
function getRate($ra, $rb) {
return 1 / (1 + pow(10, ((abs($rb - $ra) > 400) ? ((($rb - $ra) > 0) ? 400 : -400) : ($rb - $ra)) / 400));
}
function getNew($win, $ra, $rate) {
$k = 10;
return $ra + $k * ($win - $rate);
}
?>