Maths

Maths

Returns the length of the hypotenuse of a right-angle triangle with the given side lengths. Does not overflow or underflow as fast as SquareRoot(x^2 + y^2) does.

Re-exports: Angle

Functions and constants

public constant real EULER = 2.718281828

Euler’s constant

public constant real PI = 3.141592654

PI constant

public constant real PI2 = 6.283185307

PI * 2 constant

public constant real PIHALF = 1.570796326

PI / 2 constant

public function hypot(real dx, real dy) returns real
public function getSlopeAngle(real z1, real z2, real dist) returns angle

Returns the angle of a height-slope

public function int.moduloInt(int divisor) returns int

Truncated remainder: the result has the sign of the dividend, e.g. (-7).moduloInt(3) == -1

public function max(vararg int numbers) returns int

Returns the largest value in the set provided as arguments. Example: max(6, 4, -12) // Returns 6.

public function max(vararg real numbers) returns real

Returns the largest value in the set provided as arguments. Example: max(6.5, 4.5, -12.5) // Returns 6.5.

public function min(vararg int numbers) returns int

Returns the smallest value in the set provided as arguments. Example: min(6, 4, -12) // Returns -12.

public function min(vararg real numbers) returns real

Returns the smallest value in the set provided as arguments. Example: min(6.5, 4.5, -12.5) // Returns -12,5.