Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

log-scale

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-scale

Conversions and calculations on a logarithmic scale

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
184
decreased by-37.41%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 03 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc