Namespace: JustMath

JustMath

„Nope, just Math.“

Classes

Vec2

Members

<static, constant> PI :number

Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.

<static, constant> SQRT1_2 :number

Respresents the square root of 1/2.

<static, constant> SQRT2 :number

Respresents the square root of 2.

Methods

<static> abs(n) → {number}

Calculates the absolute of the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

Absolute value

Type
number

<static> acos(n) → {number}

Calculates the angle whose cosine is the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

The angle whose cosine is the specified number

Type
number

<static> asin(n) → {number}

Calculates the angle whose sine is the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

The angle whose sine is the specified number

Type
number

<static> atan(n) → {number}

Calculates the angle whose tangent is the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

The angle whose tangent is the specified number

Type
number

<static> atan2(y, x) → {number}

Calculates the angle whose tangent is the quotient of the two specified values.

Parameters:
Name Type Description
y number

Value

x number

Value

Returns:

The angle whose tangent is the quotient of the two specified values

Type
number

<static> ceil(n) → {number}

Ceils the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

Ceiled value

Type
number

<static> cos(a) → {number}

Calculates the cosine of the specified angle.

Parameters:
Name Type Description
a number

Angle

Returns:

Cosine of the specified angle

Type
number

<static> cot(a) → {number}

Calculates the cotangent of the specified angle.

Parameters:
Name Type Description
a number

Angle

Returns:

Cotangent of the specified angle

Type
number

<static> floor(n) → {number}

Floors the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

Floored value

Type
number

<static> max(n, m) → {number}

Returns the biffer of the two specified numbers.

Parameters:
Name Type Description
n number

Number

m number

Number

Returns:

The bigger of the two specified numbers

Type
number

<static> min(n, m) → {number}

Returns the lesser of the two specified numbers.

Parameters:
Name Type Description
n number

Number

m number

Number

Returns:

The lesser of the two specified numbers

Type
number

<static> pow(n, p) → {number}

Calculates the specified number raised to the specified power.

Parameters:
Name Type Description
n number

Number

p number

Power

Returns:

The specified number raised to the specified power

Type
number

<static> random() → {number}

Returns a pseudo-random number between 0 (inclusive) and 1 (exclusive).

Returns:

Pseudo-random number between 0 (inclusive) and 1 (exclusive)

Type
number

<static> round(n) → {number}

Rounds the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

Rounded value

Type
number

<static> sin(a) → {number}

Calculates the sine of the specified angle.

Parameters:
Name Type Description
a number

Angle

Returns:

Sine of the specified angle

Type
number

<static> sq(n) → {number}

Calculates the square of the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

The square of the specified number

Type
number

<static> sqrt(n) → {number}

Calculates the square root of the specified number.

Parameters:
Name Type Description
n number

Number

Returns:

Square root of the specified number

Type
number

<static> tan(a) → {number}

Calculates the tangent of the specified angle.

Parameters:
Name Type Description
a number

Angle

Returns:

Tangent of the specified angle

Type
number