WasmGPU.math.quat.isNormalized¶
Summary¶
WasmGPU.math.quat.isNormalized checks whether the input has unit length under the engine tolerance. Use it to validate inputs to rotation-sensitive code.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
q |
number[] |
Yes | Quaternion input as [x, y, z, w]. |
Returns¶
boolean - Boolean flag indicating whether the tested condition is satisfied.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const q = [0, Math.sin(Math.PI / 8), 0, Math.cos(Math.PI / 8)];
const result = wgpu.math.quat.isNormalized(q);
console.log(result);