WasmGPU.math.vec3.norm¶
Summary¶
WasmGPU.math.vec3.norm returns the Euclidean norm of the input. This is the standard magnitude measure used by many geometric operations.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
v |
number[] |
Yes | Vector input as [x, y, z]. |
Returns¶
number - Euclidean norm (magnitude) of the input.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const v = [1, 2, 3];
const result = wgpu.math.vec3.norm(v);
console.log(result);