math

This module groups together basic mathematical functions.

Functions

sqrt(n)

Performs the square root of n.

ArgumentDescription
nThe square root argument

Returns: The square root of n

sin(a)

Performs the sine function of angle a.

ArgumentDescription
aThe angle in radians

Returns: The sine of a

cos(a)

Performs the cosine function of angle a.

ArgumentDescription
aThe angle in radians

Returns: The cosine of a

tan(a)

Performs the tangent function of angle a.

ArgumentDescription
aThe angle in radians

Returns: The tangent of a

acos(n)

Performs the arccosine of n.

ArgumentDescription
nThe argument to the arccosine function

Returns: The arccosine of n

asin(n)

Performs the arcsine of n.

ArgumentDescription
nThe argument to the arcsine function

Returns: The arcsine of n

atan(n)

Performs the arctangent of n.

ArgumentDescription
nThe argument to the arctangent function

Returns: The arctangent of n

atan2(x, y)

Performs the arctangent2 of x and y.

ArgumentDescription
xThe x coordinates of the point
yThe y coordinates of the point

Returns: The arctangent2 of the point (x, y)

exp(x)

Returns e^x where e is the Euler number.

ArgumentDescription
xThe exponent

Returns: e^x

log(x)

Returns the natural logarithm of x.

ArgumentDescription
xThe argument of the logarithm

Returns: The natural logarithm of x

round(x)

Return x rounded.

ArgumentDescription
xA Number

Returns: An Integer

floor(x)

Returns the largest integer less than or equal to x.

ArgumentDescription
xA Number

Returns: An Integer

ceil(x)

Returns x rounded to the next largest integer.

ArgumentDescription
xA Number

Returns: An Integer

abs(x)

Returns the absolute value of x.

ArgumentDescription
xA Number

Returns: The absolute value of x

pow(base, exp)

Performs base^exp. This is equivalent to the power operator which is faster and thus preferable when possibile.

ArgumentDescription
baseThe exponent's base
expThe exponent

Returns: base^exp

isNaN(n)

Checks whether a given Number is a NaN value.

ArgumentDescription
nThe Number to check

Returns: true if n is NaN, false otherwise.

isInfinity(n)

Checks whether a given Number represents infinity.

ArgumentDescription
nThe Number to check

Returns: true if n represents infinity, false otherwise.

Properties

pi

Represents the ratio of the circumference of a circle to its diameter.