codetrix
Version:
A lightweight lodash-style utility library
55 lines (54 loc) • 1.78 kB
TypeScript
/**
* Converts radians to degrees.
*
* @param radians - The angle in radians.
* @returns The angle in degrees.
*/
export declare function radiansToDegrees(radians: number): number;
/**
* Converts degrees to radians.
*
* @param degrees - The angle in degrees.
* @returns The angle in radians.
*/
export declare function degreesToRadians(degrees: number): number;
/**
* Converts degrees to radians.
* Duplicate of `degreesToRadians`, included for naming flexibility.
*
* @param degrees - The angle in degrees.
* @returns The angle in radians.
*/
export declare function degToRad(degrees: number): number;
/**
* Converts radians to degrees.
* Duplicate of `radiansToDegrees`, included for naming flexibility.
*
* @param radians - The angle in radians.
* @returns The angle in degrees.
*/
export declare function radToDeg(radians: number): number;
/**
* Normalizes a degree angle to the range [0, 360).
*
* @param degrees - The input angle in degrees.
* @returns The normalized angle between 0 and 359.999...
*/
export declare function normalizeDegrees(degrees: number): number;
/**
* Calculates the smallest difference between two angles (in degrees).
*
* @param a - The first angle in degrees.
* @param b - The second angle in degrees.
* @returns The smallest angle difference in degrees.
*/
export declare function angleDifference(a: number, b: number): number;
/**
* Checks if an angle lies between two other angles, supporting wrap-around.
*
* @param angle - The angle to check.
* @param start - The start of the angle range.
* @param end - The end of the angle range.
* @returns True if angle is within the range, accounting for wrap-around.
*/
export declare function isAngleBetween(angle: number, start: number, end: number): boolean;