math.mtr
range
The range method will create a list of integers from a start value to an end value. If a third parameter is given, the list will only include every n-th value.
space
Similar to the range method, the space method will create a list of integers from a start value to an end value. However, the list will contain evenly spaced values. The default number of values is 120, but can be changed by passing a third parameter.
sin, cos, tan, asin, acos, atan
These methods will calculate the sine, cosine, tangent, arcsine, arccosine and arctangent of a value in radians.
random
The random method will return a random number between 0 and 1. The bounds of the random number can be changed by passing a start and end value as parameters. Both bounds are inclusive.
If you need integers, you can use the floor method to round down to the nearest integer. In this case, the upper bound will be exclusive, since you are rounding down.
round, floor, ceil
The rounding methods work as you would expect. The round method will round to the nearest integer, the floor method will round down to the nearest integer and the ceil method will round up to the nearest integer.
abs
The abs method will return the absolute value of a number.
sqrt, root
The sqrt method will calculate the square root of a number. The root method will calculate the n-th root of a number.
log, ln
The log method will calculate the logarithm of a number with a given base. The ln method will calculate the natural logarithm of a number.
toNumber
The toNumber method will convert a string to a number. If the string cannot be converted, an error will be thrown.
Constants
The math module also contains the constants PI and E.