GLSL math function equivalents. Work on both single values and vectors.
import {config, equals} from '@math.gl/core';
Setting configuration
import {config} from '@math.gl/core';
config.EPSILON = 1e-12;
config.debug = true;
config.printRowMajor = true;
config.precision = 4;
configure(options)
checkNumber(value)
formatValue(value, precision = config.precision || 4)
Returns true if value is either an array or a typed array
isArray(value)
Note: does not return true for ArrayBuffers and DataViews
clone(array)If the array has a clone function, calls it, otherwise returns a copy
toRadians(degrees)
Works on single values and vectors
toDegrees(radians)
Works on single values and vectors
equals(a, b, epsilon)
config.EPSILON
.equals()
method if present.exactEquals(a, b)
.exactEquals()
method if present.radians(degrees)
GLSL equivalent: Works on single values and vectors
degrees(radians)
GLSL equivalent: Works on single values and vectors
sin(radians)
GLSL equivalent: Works on single values and vectors
cos(radians)
GLSL equivalent: Works on single values and vectors
tan(radians)
GLSL equivalent: Works on single values and vectors
asin(radians)
GLSL equivalent: Works on single values and vectors
acos(radians)
GLSL equivalent: Works on single values and vectors
atan(radians)
clamp(value, min, max)
imports
and requires