Documentation

Math

Namespace

Math functions and structures.

Pi as a float.

Pi multiplied by 2 as a float.

Pi as a double.

Pi multiplied by 2 as a double.

Positive infinity as a float.

Negative infinity as a float.

Positive infinity as a double.

Negative infinity as a double.

class Math::Randomizer

A randomizer that can be seeded with a specific seed. The default constructor uses the seed 5489.

int Math::Abs(int i)
Returns int
float Math::Abs(float f)
Returns float
float Math::Sin(float f)
Returns float
float Math::Cos(float f)
Returns float
float Math::Tan(float f)
Returns float
float Math::Exp(float f)
Returns float
float Math::Rand(float min, float max)

Generate a random floating point value between min (inclusive) and max (exclusive).

Returns float
int Math::Rand(int min, int max)

Generate a random integer between min (inclusive) and max (exclusive).

Returns int
float Math::Log(float f)
Returns float
int Math::Min(int x, int y)

Returns x or y, whichever is lower.

Returns int
float Math::Min(float x, float y)

Returns x or y, whichever is lower.

Returns float
int Math::Max(int x, int y)

Returns x or y, whichever is higher.

Returns int
float Math::Max(float x, float y)

Returns x or y, whichever is higher.

Returns float
int Math::Clamp(int x, int min, int max)

Clamps the value x between min and max. Throws an exception when min is higher than max.

Returns int
float Math::Clamp(float x, float min, float max)

Clamps the value x between min and max. Throws an exception when min is higher than max.

Returns float