Microsoft.Xna.Framework.MathHelper.WrapAngle C# (CSharp) Method

WrapAngle() public static method

public static WrapAngle ( float angle ) : float
angle float
return float
        public static float WrapAngle(float angle)
        {
            angle = (float)Math.IEEERemainder((double)angle, 6.2831854820251465);
            if (angle <= -3.14159274f)
            {
                angle += 6.28318548f;
            }
            else if (angle > 3.14159274f)
            {
                angle -= 6.28318548f;
            }
            return angle;
        }
    }