Math#wrapAngle()

wrapAngle(angle, radians) → {number}

Keeps an angle value between -180 and +180; or -PI and PI if radians.

Parameters
Name Type Argument Default Description
angle number

The angle value to wrap

radians boolean <optional>
false

Set to true if the angle is given in radians, otherwise degrees is expected.

Returns
number -

The new angle value; will be the same as the input angle if it was within bounds.

Source code: math/Math.js (Line 727)
doc_phaser
2017-02-14 10:55:07
Comments
Leave a Comment

Please login to continue.