was.php
/trunk/src/mathematics/algebra.php |
---|
@@ -0,0 +1,20 @@ |
<?php |
########################################################################## |
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
########################################################################### |
function mapValueToRange($value, $xMin, $xMax, $yMin, $yMax) { |
return $yMin + ( |
( |
$yMax - $yMin |
) |
* |
( |
$value - $xMin |
) |
/ |
( |
$xMax - $xMin |
) |
); |
} |