diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-12-15 01:50:56 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-12-15 16:16:31 -0500 |
commit | d744fb826f4a6d6ce560f3b78f2e63a1f9666d9e (patch) | |
tree | 35d0939c959cec372e1a6ce2f4bdf95dbe977918 /wirish/wirish_math.h | |
parent | 74c8937446e1be4e0d21f69a8c098e2caf7814d5 (diff) | |
download | librambutan-d744fb826f4a6d6ce560f3b78f2e63a1f9666d9e.tar.gz librambutan-d744fb826f4a6d6ce560f3b78f2e63a1f9666d9e.zip |
Finalized 0.0.9 documentation.
Diffstat (limited to 'wirish/wirish_math.h')
-rw-r--r-- | wirish/wirish_math.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wirish/wirish_math.h b/wirish/wirish_math.h index 4156722..14614ba 100644 --- a/wirish/wirish_math.h +++ b/wirish/wirish_math.h @@ -79,8 +79,10 @@ long random(long min, long max); * @return the mapped value. */ /* TODO: profile code bloat due to inlining this */ -inline long map(long x, long in_min, long in_max, long out_min, long out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; +inline long map(long value, long fromStart, long fromEnd, + long toStart, long toEnd) { + return (value - fromStart) * (toEnd - toStart) / (fromEnd - fromStart) + + toStart; } #define PI 3.1415926535897932384626433832795 |