Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

math-scale.js 583B

12345678910111213141516
  1. // `Math.scale` method implementation
  2. // https://rwaldron.github.io/proposal-math-extensions/
  3. module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
  4. if (
  5. arguments.length === 0
  6. /* eslint-disable no-self-compare -- NaN check */
  7. || x != x
  8. || inLow != inLow
  9. || inHigh != inHigh
  10. || outLow != outLow
  11. || outHigh != outHigh
  12. /* eslint-enable no-self-compare -- NaN check */
  13. ) return NaN;
  14. if (x === Infinity || x === -Infinity) return x;
  15. return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
  16. };