interpolate-angle
v1.0.2
Published
Linear interpolation between two angles along the shorter arc
Downloads
27
Readme
interpolate-angle
Linear interpolation between two angles along the shorter arc
Usage
interpolateAngle(from, to, t)
Parameters:from
- angle in radians 0..2PIto
- angle in radians 0..2PIt
- interpolation ratio 0..1
var interpolateAngle = require('interpolate-angle');
interpolateAngle(0, 2 * Math.PI, 0.5) //-> PI
interpolateAngle(-Math.PI/6, Math.PI/6, 0.5) //-> 0
interpolateAngle(Math.PI*5/3, Math.PI/3, 0.25) //-> -1/6 PI
License
MIT, see LICENSE.md for details.