Math

An integer is a collection of positive and negative whole numbers and zero(es); Mathematical operations utilize integers as their primary source of data.

General


mFloor

Rounds %value down to the nearest whole number

==> mCeil(3.1415);
3

mCeil

Rounds %value up to the nearest whole number

==> mCeil(3.1415);
4

mAbs

Converts %value to an absolute value

==> mAbs(-15);
15

mFloatLength

Rounds %value to the amount of decimal places specified in %numDecimals.

==> mFloatLength(3.1415, 2);
3.14

mSqrt

Returns the square root of %value.

==> mSqrt(9);
3

mPow

Raises %value to power specified in %power.

==> mPow(2, 3);
8

mClamp

Limits the %value given to in-between the %low and %high integer values.

==> mClamp(7, 5, 10);
7
==> mClamp(3, 5, 10);
5
==> mClamp(13, 5, 10);
10

mClampF

Limits the %value given to in-between the %low and %high float values.

mLog

Returns the natural logarithm, in base 10, of %value.

mSin

Returns the Trigonometric sine, in radians, of %value.

mSin

Returns the Trigonometric cosine, in radians, of %value.

mTan

Returns the Trigonometric tangent, in radians, of %value.

mAsin

Returns the Trigonometric arc-sine, in radians, of %value.

mAcos

Returns the Trigonometric arc-cosine, in radians, of %value.

mAtan

Returns the Trigonometric arc-tangent, in radians, of %value.

mRadToDeg

Converts radian value %radians to degrees.

mDegToRad

Converts degree value %degrees to radians.

getMin

Returns the smaller of the two %value1 and %value2 numbers.

==> getMin(3, 9);
3

getMax

Returns the larger of the two %value1 and %value2 numbers.

==> getMax(3, 9);
9

atoi

Returns an integer representation of the string, %string

==> atoi("1337");
1337

atof

Returns a float representation of the string, %string

==> atof("3.14");
3.14

Vectors


vectorAdd

Adds %vector1 and %vector2 together and returns the resulting vector.

==> vectorAdd("1 2 3", "3 2 1");
"4 4 4"

vectorSub

Subtracts %vector2 from %vector1 and returns the resulting vector.

==> vectorSub("3 3 3", "2 2 1");
"1 1 2"

vectorScale

Scales (multiplies) the %vector by the float %scalar and returns it.

==> vectorScale("2 2 2", 4);
"8 8 8"

vectorDot

Calculates and returns the dot product of %vector1 and %vector2.

==> vectorDot("2 2 2", "4 4 4");
24

vectorDist

Calculates and returns the distance between %vector1 and %vector2.

==> vectorDist("2 2 2", "4 4 4");
3.4641

vectorLen

Calculates and returns the length of %vector.

==> vectorLen("5 5 5");
8.66025

vectorNormalize

Normalizes and then returns the vector %vector through making its length equal one.

vectorCross

Calculates and returns the cross product of %vector1 and %vector2.