Skip to main content

math

The math library contains functions that are used for mathematical operations. The library can be accessed by the expression //math

//math.pi <: number#

pi is the number pi, ฯ€.

Usage:

//math.pi

//math.e <: number#

e is the euler number.

Usage:

//math.e

//math.sin(n <: number) <: number#

sin calculates the sine of n, which is an angle measured in radians.

Usage:

exampleequals
//math.sin(1)0.8414709848078965
//math.sin(0)0

//math.cos(n <: number) <: number#

cos calculates the cosine of n, which is an angle measured in radians.

Usage:

exampleequals
//math.cos(1)0.5403023058681398
//math.cos(0)1