UNPKG

@qbead/bloch-sphere

Version:

A 3D Bloch Sphere visualisation built with Three.js and TypeScript.

11 lines (10 loc) 289 B
/** * Normalize an azimuthal angle to the range [0, 2π). * * @param angle - The angle in radians to normalize. * @returns The normalized angle in radians. */ export function normalizeAzimuthal(angle: number) { const twoPi = 2 * Math.PI return ((angle % twoPi) + twoPi) % twoPi }