Rescale data
npm i rescale
var Decimal = require('linear-arbitrary-precision')(require('floating-adapter'));
var rescale = require('rescale')(Decimal).rescale;
rescale([-3, 5], [10, 20], -1); // => Decimal 12.5
rescale([0, 100], [32, 212], 40); // => Decimal 104
See spec.
- linear-converter: flexible linear converter with built in conversions for common units.
- scale: scales normalised data.
- normalise: normalise data to [0, 1].
- rescale-util: rescale utilities.