was.js – Blame information for rev 41
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
7 | office | 1 | /*************************************************************************/ |
2 | /* Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 */ |
||
3 | /*************************************************************************/ |
||
4 | function wasMapValueToRange(value, xMin, xMax, yMin, yMax) { |
||
5 | return yMin + ( |
||
6 | ( yMax - yMin ) * ( value - xMin ) / ( xMax - xMin ) |
||
7 | ); |
||
8 | } |
||
25 | office | 9 | |
10 | /*************************************************************************/ |
||
11 | /* Node.JS package export. */ |
||
12 | /*************************************************************************/ |
||
41 | office | 13 | if(typeof module !== 'undefined' && typeof module.exports !== 'undefined') { |
34 | office | 14 | module.exports.mathematics = { |
15 | MapValueToRange: wasMapValueToRange |
||
16 | }; |
||
17 | } |