was.php

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 9  →  ?path2? @ 10
/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
)
);
}