Should be between -pi, pi #5075

This commit is contained in:
Richard Davey 2020-04-27 10:23:44 +01:00
parent b3128f9c74
commit 92e4345c0e

View file

@ -1,8 +1,15 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @author @samme
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var FloatBetween = require('../FloatBetween');
var CONST = require('../const');
/**
* Returns a random angle in the range [0, 2pi].
* Returns a random angle in the range [-pi, pi].
*
* @function Phaser.Math.Angle.Random
* @since 3.23.0
@ -11,7 +18,7 @@ var CONST = require('../const');
*/
var Random = function ()
{
return FloatBetween(0, CONST.PI2);
return FloatBetween(-Math.PI, Math.PI);
};
module.exports = Random;