Skip to main content

Namespace: math

index.math

Variables#

deg2rad#

Const deg2rad: number

Constant coefficient to convert degrees to radians.

Defined in#

systems/math.ts:4


epsilon#

Const epsilon: 0.000001

A small value to approximately compare values.

Defined in#

systems/math.ts:12


rad2deg#

Const rad2deg: number

Constant coefficient to convert radians to degrees.

Defined in#

systems/math.ts:8

Functions#

approximately#

approximately(a, b): boolean

Checks if a is approximately equal to b.

Parameters#

NameType
anumber
bnumber

Returns#

boolean

Defined in#

systems/math.ts:45


clamp#

clamp(value, min, max): number

Clamps the specified value between a minimum and a maximum.

Parameters#

NameType
valuenumber
minnumber
maxnumber

Returns#

number

Defined in#

systems/math.ts:38


invlerp#

invlerp(a, b, v): number

Inversely lerps v between a and b to find t.

Parameters#

NameType
anumber
bnumber
vnumber

Returns#

number

Defined in#

systems/math.ts:31


lerp#

lerp(a, b, t): number

Linearly interpolates between a and b by t.

Parameters#

NameType
anumber
bnumber
tnumber

Returns#

number

Defined in#

systems/math.ts:17


slerp#

slerp(a, b, t): number

Smoothly interpolates between a and b by t (using cosine interpolation).

Parameters#

NameType
anumber
bnumber
tnumber

Returns#

number

Defined in#

systems/math.ts:24