Monkey Documentation

Module monkey.math

The math module provides math related constants and functions.


Constants:
  • HALFPI : Float
  • PI : Float
  • TWOPI : Float
Functions:
  • ACos : Float ( x:Float )
  • ACosr : Float ( x:Float )
  • ASin : Float ( x:Float )
  • ASinr : Float ( x:Float )
  • ATan : Float ( x:Float )
  • ATan2 : Float ( x:Float, y:Float )
  • ATan2r : Float ( x:Float, y:Float )
  • ATanr : Float ( x:Float )
  • Abs : Int ( x:Int )
  • Abs : Float ( x:Float )
  • Ceil : Float ( x:Float )
  • Clamp : Int ( x:Int, min:Int, max:Int )
  • Clamp : Float ( x:Float, min:Float, max:Float )
  • Cos : Float ( x:Float )
  • Cosr : Float ( x:Float )
  • Exp : Float ( x:Float )
  • Floor : Float ( x:Float )
  • Log : Float ( x:Float )
  • Max : Int ( x:Int, y:Int )
  • Max : Float ( x:Float, y:Float )
  • Min : Int ( x:Int, y:Int )
  • Min : Float ( x:Float, y:Float )
  • Pow : Float ( x:Float, y:Float )
  • Sgn : Int ( x:Int )
  • Sgn : Float ( x:Float )
  • Sin : Float ( x:Float )
  • Sinr : Float ( x:Float )
  • Sqrt : Float ( x:Float )
  • Tan : Float ( x:Float )
  • Tanr : Float ( x:Float )

Function Documentation

Function ACos : Float ( x:Float )

Returns the arc cosine of x, in degrees.

Function ACosr : Float ( x:Float )

Returns the arc cosine of x, in radians.

Function ASin : Float ( x:Float )

Returns the arc sine of x, in degrees.

Function ASinr : Float ( x:Float )

Returns the arc sine of x, in radians.

Function ATan : Float ( x:Float )

Returns the arc tangent of x, in degrees.

Function ATan2 : Float ( x:Float, y:Float )

Returns the arc tangent of x / y, in degrees.

The function uses the signs of x and y to compute the correct quadrant for the result.

Function ATan2r : Float ( x:Float, y:Float )

Returns the arc tangent of x / y, in radians.

The function uses the signs of x and y to compute the correct quadrant for the result.

Function ATanr : Float ( x:Float )

Returns the arc tangent of x, in radians.

Function Abs : Int ( x:Int )

Returns the absolute value of x, that is, +x if x>=0 and -x if x<0.

Function Abs : Float ( x:Float )

Returns the absolute value of x, that is, +x if x>=0 and -x if x<0.

Function Ceil : Float ( x:Float )

Returns the smallest integral value that is not less than x.

Function Clamp : Int ( x:Int, min:Int, max:Int )

Clamps x to the range min through max inclusive.

Function Clamp : Float ( x:Float, min:Float, max:Float )

Clamps x to the range min through max inclusive.

Function Cos : Float ( x:Float )

Returns the cosine of x degrees.

Function Cosr : Float ( x:Float )

Returns the cosine of x radians.

Function Exp : Float ( x:Float )

Returns the base-e exponential function of x, which is the e number raised to the power x.

Function Floor : Float ( x:Float )

Returns the largest integral value that is not greater than x.

Function Log : Float ( x:Float )

Returns the natural logarithm of x.

Function Max : Int ( x:Int, y:Int )

Returns the maximum of x and y.

Function Max : Float ( x:Float, y:Float )

Returns the maximum of x and y.

Function Min : Int ( x:Int, y:Int )

Returns the minimum of x and y.

Function Min : Float ( x:Float, y:Float )

Returns the minimum of x and y.

Function Pow : Float ( x:Float, y:Float )

Returns x raised to the power y.

Function Sgn : Int ( x:Int )

Returns -1 if x is less than zero, +1 if x is greater than zero or 0 if x is equal to zero.

Function Sgn : Float ( x:Float )

Returns -1 if x is less than zero, +1 if x is greater than zero or 0 if x is equal to zero.

Function Sin : Float ( x:Float )

Returns the sine of x degrees.

Function Sinr : Float ( x:Float )

Returns the sine of x radians.

Function Sqrt : Float ( x:Float )

Returns the square root of x.

Function Tan : Float ( x:Float )

Returns the tangent of x degrees.

Function Tanr : Float ( x:Float )

Returns the tangent of x radians.