@core-es/math-extensions
v1.0.0
Published
Implementation of the Math Extensions Proposal by https://github.com/rwaldron
Downloads
7
Maintainers
Readme
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
- Stage: 1
- Spec: https://rwaldron.github.io/proposal-math-extensions/
- Updated: July 28, 2016
license
Copyright © 2018+ Futago-za Ryuu, https://github.com/futagoza Released under the MIT License, http://opensource.org/licenses/MIT.