Misty Programming Language:

Math Functions

Cycles Degrees Radians Gradians
0.25 90 π/2 100
0.5 180 π 200
0.75 270 3π/2 300
1 360 2π 400

The trigonometric methods (math.arc_cosine, math.arc_sine, math.arc_tangent, math.cosine, math.sine, and math.tangent) express angles as radians.\

use math

math.arc_cosine(number)

Compute the arc cosine of a The number should be between -1 and 1. The result is the inverse cosine, in radians, between 0 and 2π.

math.arc_sine(number)

Compute the arc sine of a The number should be between -1 and 1. The result is the inverse sine, in cycles, between neg(π) and π.

math.arc_tangent(number, denominator)

Compute the arc tangent of a If the optional denominator is supplied, then the value is obtained from number / denominator, using the signs of both to determine the quadrant. The denominator is allowed to be 0. The result is the inverse tangent, in radians, between neg(π) and π.

math.cosine(number)

Compute the cosine. The number should be in radians. The result is between -1 and 1.

math.e(power | 1)

Compute the transcendental constant e raised to a power.

math.log(number)

Compute the natural logarithm of the

math.log10(number)

Compute the base-10 logarithm of the

math.log2(number)

Compute the base-2 logarithm of the

math.power(first, second)

Raise to a power.

math.root(radicand, number)

Take the root.

math.sine(number)

Compute the sine. The number should be in radians. The result is the sine, between -1 and 1.

math.sqrt(number)

The square root of the number is computed.

Examples:

let result: sqrt(256)    # result is 16
let result: sqrt(-1)     # result is null 

math.tangent(number)

Compute the tangent. The number should be in radians.