Namespace math

xeokit SDK Math Libraries


Mathematical functions for 2D/3D matrices, quaternions, and vectors


This library provides a set of utilities for working with mathematical operations commonly used in 3D graphics, including vector and matrix operations such as dot products, vector negation, addition, and more.

Installation

To install the xeokit SDK, use the following npm command:

npm install @xeokit/sdk

Usage

You can import and use functions from the math module as follows:

import { dotVec3, createVec3Float64 } from "@xeokit/sdk/math";

const a = createVec3Float64([0.1, 1, 2.1]);
const b = createVec3Float64([0.5, 2.1, -1.3]);

const c = dotVec3(a, b); // Computes the dot product of vectors a and b

Namespaces

boundaries
compression
curves
matrix
quat
rtc
vector

Type Aliases

FloatArrayParam
FloatTypedArray
IntArrayParam
IntTypedArray
NumericTypedArray

Variables

DEGTORAD
MAX_DOUBLE
MAX_INT
MIN_DOUBLE
RADTODEG

Functions

canvasPosToWorldRay
clamp
newFloatArray
rayTriangleIntersect
safeInv
transformRay