Const HALFPI : Float
Module cerberus.math
The math module provides math related constants and functions. More...
Declarations
Imported By | |
---|---|
cerberus
|
Constants | |
---|---|
HALFPI : Float |
|
PI : Float |
|
TWOPI : Float |
Functions | |
---|---|
Abs : Float ( x:Float ) |
Returns the absolute value of x, that is, +x if x>=0 and -x if x<0. |
Abs : Int ( x:Int ) |
Returns the absolute value of x, that is, +x if x>=0 and -x if x<0. |
ACos : Float ( x:Float ) |
Returns the arc cosine of x, in degrees. |
ACosr : Float ( x:Float ) |
Returns the arc cosine of x, in radians. |
ASin : Float ( x:Float ) |
Returns the arc sine of x, in degrees. |
ASinr : Float ( x:Float ) |
Returns the arc sine of x, in radians. |
ATan : Float ( x:Float ) |
Returns the arc tangent of x, in degrees. |
ATan2 : Float ( y:Float, x:Float ) |
Returns the arc tangent of x / y, in degrees ranging from -180 to +180. |
ATan2r : Float ( y:Float, x:Float ) |
Returns the arc tangent of x / y, in radians ranging from -PI to +PI. |
ATanr : Float ( x:Float ) |
Returns the arc tangent of x, in radians. |
Ceil : Float ( x:Float ) |
Returns the smallest integral value that is not less than x. |
Clamp : Float ( x:Float, min:Float, max:Float ) |
Clamps x to the range min through max inclusive. |
Clamp : Int ( x:Int, min:Int, max:Int ) |
Clamps x to the range min through max inclusive. |
Cos : Float ( x:Float ) |
Returns the cosine of x degrees. |
Cosr : Float ( x:Float ) |
Returns the cosine of x radians. |
Exp : Float ( x:Float ) |
Returns the base-e exponential function of x, which is the e number raised to the power x. |
Floor : Float ( x:Float ) |
Returns the largest integral value that is not greater than x. |
Log : Float ( x:Float ) |
Returns the natural logarithm of x. |
Max : Float ( x:Float, y:Float ) |
Returns the maximum of x and y. |
Max : Int ( x:Int, y:Int ) |
Returns the maximum of x and y. |
Min : Float ( x:Float, y:Float ) |
Returns the minimum of x and y. |
Min : Int ( x:Int, y:Int ) |
Returns the minimum of x and y. |
Pow : Float ( x:Float, y:Float ) |
Returns x raised to the power y. |
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. |
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. |
Sin : Float ( x:Float ) |
Returns the sine of x degrees. |
Sinr : Float ( x:Float ) |
Returns the sine of x radians. |
Sqrt : Float ( x:Float ) |
Returns the square root of x. |
Tan : Float ( x:Float ) |
Returns the tangent of x degrees. |
Tanr : Float ( x:Float ) |
Returns the tangent of x radians. |
Detailed Discussion
The math module provides math related constants and functions.
Constants Documentation
Const PI : Float
Const TWOPI : Float
Functions Documentation
Function Abs : Float ( x:Float )
Returns the absolute value of x, that is, +x if x>=0 and -x if x<0.
Parametersx - input value.
Function Abs : Int ( x:Int )
Returns the absolute value of x, that is, +x if x>=0 and -x if x<0.
Parametersx - input value.
Function ACos : Float ( x:Float )
Returns the arc cosine of x, in degrees.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function ACosr : Float ( x:Float )
Returns the arc cosine of x, in radians.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function ASin : Float ( x:Float )
Returns the arc sine of x, in degrees.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function ASinr : Float ( x:Float )
Returns the arc sine of x, in radians.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function ATan : Float ( x:Float )
Returns the arc tangent of x, in degrees.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function ATan2 : Float ( y:Float, x:Float )
Returns the arc tangent of x / y, in degrees ranging from -180 to +180.
The function uses the signs of x and y to compute the correct quadrant for the result.
Print Atan2
(
0
,
1
)
' 0
Print Atan2
(
1
,
1
)
' 45
Print Atan2
(
1
,
0
)
' 90
Print Atan2
(-
1
,
0
)
' -90
x, y - floating point values.
Function ATan2r : Float ( y:Float, x:Float )
Returns the arc tangent of x / y, in radians ranging from -PI to +PI.
The function uses the signs of x and y to compute the correct quadrant for the result.
Print Atan2r
(
0
,
1
)
' 0
Print Atan2r
(
1
,
1
)
' approx PI/4
Print Atan2r
(
1
,
0
)
' approx PI/2
Print Atan2r
(-
1
,
0
)
' approx -PI/2
x, y - floating point values.
Function ATanr : Float ( x:Float )
Returns the arc tangent of x, in radians.
Parametersx - floating point value in the range -1 to 1 (inclusive).
Function Ceil : Float ( x:Float )
Returns the smallest integral value that is not less than x.
Parametersx - floating point value.
Function Clamp : Float ( x:Float, min:Float, max:Float )
Clamps x to the range min through max inclusive.
Parametersx - value to clamp
min - minimum returnable value
max - maximum returnable value
Function Clamp : Int ( x:Int, min:Int, max:Int )
Clamps x to the range min through max inclusive.
Parametersx - value to clamp
min - minimum returnable value
max - maximum returnable value
Function Cos : Float ( x:Float )
Returns the cosine of x degrees.
Parametersx - angle in degrees.
Function Cosr : Float ( x:Float )
Returns the cosine of x radians.
Parametersx - angle in radians.
Function Exp : Float ( x:Float )
Returns the base-e exponential function of x, which is the e number raised to the power x.
Parametersx - floating point value.
Function Floor : Float ( x:Float )
Returns the largest integral value that is not greater than x.
Parametersx - floating point value.
Function Log : Float ( x:Float )
Returns the natural logarithm of x.
Parametersx - floating point value.
Function Max : Float ( x:Float, y:Float )
Returns the maximum of x and y.
Parametersx, y - input values.
Function Max : Int ( x:Int, y:Int )
Returns the maximum of x and y.
Parametersx, y - input values.
Function Min : Float ( x:Float, y:Float )
Returns the minimum of x and y.
Parametersx, y - input values.
Function Min : Int ( x:Int, y:Int )
Returns the minimum of x and y.
Parametersx, y - input values.
Function Pow : Float ( x:Float, y:Float )
Returns x raised to the power y.
Parametersx, y - float point values.
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.
Parametersx - input value.
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.
Parametersx - input value.
Function Sin : Float ( x:Float )
Returns the sine of x degrees.
Parametersx - angle in degrees.
Function Sinr : Float ( x:Float )
Returns the sine of x radians.
Parametersx - angle in radians.
Function Sqrt : Float ( x:Float )
Returns the square root of x.
Parametersx - floating point value.
Function Tan : Float ( x:Float )
Returns the tangent of x degrees.
Parametersx - angle in degrees.
Function Tanr : Float ( x:Float )
Returns the tangent of x radians.
Parametersx - angle in radians.