Skip to content

Documentation / @interstellar-tools/equations / norm

Function: norm() ​

ts
function norm(v: Vector3DTupleType): number;

Defined in: helpers/misc.ts:22

Compute the Euclidean norm (length / magnitude) of a 3D vector.

‖v‖=x2+y2+z2

Uses Math.hypot for numerical stability.

Parameters ​

ParameterTypeDescription
vVector3DTupleType3D vector [x, y, z].

Returns ​

number

Vector magnitude (same units as the components of v).

Example ​

ts
norm([3, 4, 12]); // 13