MathHelper
Contains common mathematical functions and constants.
Methods
BinomialCoefficient(int, int) : long
Calculates the binomial coefficient above .
- n
- The n.
- k
- The k.
Returns: n! / (k! * (n - k)!)
DegreesToRadians(double) : double
Convert degrees to radians
- degrees
- An angle in degrees
Returns: The angle expressed in radians
InverseSqrtFast(double) : double
Returns an approximation of the inverse square root of left number.
- x
- A number.
Returns: An approximation of the inverse square root of the specified number, with an upper error bound of 0.001
InverseSqrtFast(float) : double
Returns an approximation of the inverse square root of left number.
- x
- A number.
Returns: An approximation of the inverse square root of the specified number, with an upper error bound of 0.001
NextPowerOfTwo(long) : double
Returns the next power of two that is larger than the specified number.
- n
- The specified number.
Returns: The next power of two.
NextPowerOfTwo(double) : double
Returns the next power of two that is larger than the specified number.
- n
- The specified number.
Returns: The next power of two.
NextPowerOfTwo(float) : double
Returns the next power of two that is larger than the specified number.
- n
- The specified number.
Returns: The next power of two.
NextPowerOfTwo(int) : double
Returns the next power of two that is larger than the specified number.
- n
- The specified number.
Returns: The next power of two.
RadiansToDegrees(double) : double
Convert radians to degrees
- radians
- An angle in radians
Returns: The angle expressed in degrees
Fields
ThreePiOver2 : double
Defines the value of Pi multiplied by 3 and divided by two as a Single.