Mathematical constants and functions, plus a random number generator.

Constants

E double

const 2.718281828459045
LN10 double

const 2.302585092994046
LN2 double

const 0.6931471805599453
LOG10E double

const 0.4342944819032518
LOG2E double

const 1.4426950408889634
PI double

const 3.1415926535897932
SQRT1_2 double

const 0.7071067811865476
SQRT2 double

const 1.4142135623730951

Functions

acos(num x) double

Converts x to a double and returns the arc cosine of the value.

asin(num x) double

Converts x to a double and returns the arc sine of the value.

atan(num x) double

Converts x to a dobule and returns the arc tangent of the value.

atan2(num a, num b) double

A variant of atan.

cos(num x) double

Converts x to a double and returns the cosine of the value.

exp(num x) double

Converts x to a double and returns the natural exponent, E, to the power x.

log(num x) double

Converts x to a double and returns the natural logarithm of the value.

max(num a, num b) num

Returns the larger of two numbers.

min(num a, num b) num

Returns the lesser of two numbers.

pow(num x, num exponent) num

Returns x to the power of exponent.

sin(num x) double

Converts x to a double and returns the sine of the value.

sqrt(num x) double

Converts x to a double and returns the positive square root of the value.

tan(num x) double

Converts x to a double and returns the tangent of the value.

Classes

MutableRectangle

A class for representing two-dimensional axis-aligned rectangles with mutable properties.

Point

A utility class for representing two-dimensional positions.

Random

A generator of random bool, int, or double values.

Rectangle

A class for representing two-dimensional rectangles whose properties are immutable.