Advertisement
zegige

functions.php

Dec 28th, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. // Calculate the expected % outcome
  4. function expected($Rb, $Ra) {
  5.     return 1/(1 + pow(10, ($Rb-$Ra)/400));
  6. }
  7.  
  8. // Calculate the new winnner score
  9. function win($score, $expected, $k = 24) {
  10.     return $score + $k * (1-$expected);
  11. }
  12.  
  13. // Calculate the new loser score
  14. function loss($score, $expected, $k = 24) {
  15.     return $score + $k * (0-$expected);
  16. }
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement