Skip to content

magnitude(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

magnitude(l : number[]) : number;

Calculates the length of a three-dimensional vector.

The length of the vector is calculated as follows sqrt(x*x + y*y + z*z).

ParameterTypeDescription
lnumber[]The vector to add.

The magnitude of the vector as a single number.