Namespace: Math

RS.Math

Contains general 3D Math functionality. This provides a number of classes for manipulating vectors, matrices and colors plus some general functions on RS.Math.

Note that all classes and functions on RS.Math are also available directly on RS. This is to make acessing the classes easier when exposed as ES6 modules.

Example

import { Vector4, radians } from '@migenius/realityserver-client';
// as opposed to
import { Math as RSMath } from '@migenius/realityserver-client';
const { Vector4, radians } = RSMath;

Classes

Color
Matrix4x4
Spectrum
Vector2
Vector3
Vector4

Members

ALMOST_ZERO constant

A number that is very close to zero.

Methods

degrees (radians)Number

Converts a value from radians to degrees.

Name Type Description
radians Number

the value in radians.

Returns:
Type Description
Number the value in degrees.

radians (degrees)Number

Converts a value from degrees to radians.

Name Type Description
degrees Number

the value in degrees.

Returns:
Type Description
Number the value in radians.