phaser4-rex-plugins
Version:
26 lines (22 loc) • 595 B
JavaScript
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
import MathWrap from '../Wrap.js';
/**
* Wrap an angle.
*
* Wraps the angle to a value in the range of -PI to PI.
*
* @function Phaser.Math.Angle.Wrap
* @since 3.0.0
*
* @param {number} angle - The angle to wrap, in radians.
*
* @return {number} The wrapped angle, in radians.
*/
var Wrap = function (angle) {
return MathWrap(angle, -Math.PI, Math.PI);
};
export default Wrap;