Skip to content

bmcmahen/linear-conversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linear-conversion

A basic linear conversion utlity. Scales a number from an old range to a new range.

Installation

$ component install bmcmahen/linear-conversion

API

// Import the module
var linearConversion = require('bmcmahen-linear-conversion');

// Create your scale, with a domain and range
var scale = linearConversion([0, 10], [0, 100]);
alert(scale(1)); // alerts 10

License

MIT

About

given x in range1, get y in range2

Resources

Stars

Watchers

Forks

Packages

No packages published