phaser
Version:
A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.
27 lines (23 loc) • 719 B
JavaScript
/**
* @author Richard Davey <rich@phaser.io>
* @copyright 2013-2026 Phaser Studio Inc.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Normalize = require('./Normalize');
/**
* Reverses the given angle by adding π radians (180 degrees) to it, then normalizing
* the result to the range of [0, 2π). This returns the angle pointing in the exact
* opposite direction to the one provided.
*
* @function Phaser.Math.Angle.Reverse
* @since 3.0.0
*
* @param {number} angle - The angle to reverse, in radians.
*
* @return {number} The reversed angle, in radians.
*/
var Reverse = function (angle)
{
return Normalize(angle + Math.PI);
};
module.exports = Reverse;