@technobuddha/library
Version:
A large library of useful functions
21 lines (20 loc) • 666 B
TypeScript
import { type UnitOptions } from './angle.ts';
/**
* Normalizes an angle to be in range 0-1 turns.
*
* Angles outside this range will be normalized to be the equivalent angle with that range.
* Angles are always returned as radians.
* @param angle - Angle
* @param options - see {@link UnitOptions}
* @returns Standardized angle in radians.
* @example
* ```typescript
* normalizeAngle(Math.PI); // π
* normalizeAngle(2 * Math.PI); // 0
* normalizeAngle(180, 'degrees'); // π
* normalizeAngle(540, 'degrees'); // π
* ```
* @group Geometry
* @category Angle
*/
export declare function normalizeAngle(angle: number, { unit }?: UnitOptions): number;