Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conv(val, slope_min = 0, slope_max = 1) {
- val = val / 100;
- const r = ((slope_max * (val)) - (slope_min * (val)) - (slope_min * -1)).toFixed(8);
- return Number(r);
- },
- reverseConv(val, min, max) {
- return ((val - min) / (max - min)) * 100;
- },
- convRange(value, realMin, realMax, min, max, isReverse = false) {
- if (isReverse) {
- return _LIB.lib.conv((((value - realMin) / (realMax - realMin)) * 100), min, max);
- }
- return _LIB.lib.conv((((value - realMin) / (realMax - realMin)) * 100), min, max);
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement