1.0.0 • Published 6 years ago

@core-es/math-extensions v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

This package contains implementations of methods and constants in the Math Extensions Proposal.

api

@core-es/math-extensions/clamp

Math.clamp(x: number, lower: number, upper: number) => number

Clamp a number.

@core-es/math-extensions/DEG_PER_RAD

Math.DEG_PER_RAD: number

A Number value of approximately 0.0174532925199432.

@core-es/math-extensions/RAD_PER_DEG

Math.RAD_PER_DEG: number

A Number value of approximately 57.29577951308232.

@core-es/math-extensions/scale

Math.scale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number) => number

@core-es/math-extensions/fscale

Math.fscale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number) => number

@core-es/math-extensions/radians

Math.radians(degrees: number) => number

@core-es/math-extensions/degrees

Math.degrees(radians: number) => number

polyfill

You can polyfill each of the above methods and constants by importing it's */polyfill module.

For example, to polyfill Math.clamp, you import: @core-es/math-extensions/clamp/polyfill

proposal status

license

Copyright © 2018+ Futago-za Ryuu, https://github.com/futagoza Released under the MIT License, http://opensource.org/licenses/MIT.