log-scale

Logarithmic scale class that helps with conversions and calculations

Showing:

Popularity

Downloads/wk

53

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

log-scale

log-scale is a logarithmic scale class that helps with conversions and calculations.

Usage

Create a LogScale by passing in your min and max values:

var logScale = new LogScale(1, 100);

You can then convert from a 0 to 1 linear scale and the logarithmic scale and vice versa. For example, if you want the value at the middle of the scale:

logScale.linearToLogarithmic(.5); // 10

And going the other way:

logScale.logarithmicToLinear(1); // 0
logScale.logarithmicToLinear(10); // .5
logScale.logarithmicToLinear(100); // 1

Testing

You can run the tests with the following command:

jasmine

License

This project is licensed under the Apache v2.0 license. See the LICENSE file for more.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100