UNPKG

@ue-too/board

Version:
65 lines (64 loc) 1.63 kB
/** * @description The limits of the rotation. * * @category Camera */ export type RotationLimits = { start: number; end: number; ccw: boolean; startAsTieBreaker: boolean; }; /** * @description The boundary of the rotation. (experimental) * * @category Camera */ export type RotationBoundary = { start: number; end: number; positiveDirection: boolean; startAsTieBreaker: boolean; }; /** * @description Clamps the rotation within the limits. * * @category Camera */ export declare function clampRotation(rotation: number, rotationLimits?: RotationLimits): number; /** * @description Checks if the rotation is within the limits. * * @category Camera */ export declare function rotationWithinLimits(rotation: number, rotationLimits?: RotationLimits): boolean; /** * @description Checks if the rotation is within the boundary. (experimental) * * @category Camera */ export declare function rotationWithinBoundary(rotation: number, rotationBoundary: RotationBoundary): boolean; /** * @description Normalizes the angle to be between 0 and 2π. * * @category Camera */ export declare function normalizeAngleZero2TwoPI(angle: number): number; /** * @description Gets the smaller angle span between two angles. (in radians) * * @category Camera */ export declare function angleSpan(from: number, to: number): number; /** * @description Converts degrees to radians. * * @category Camera */ export declare function deg2rad(deg: number): number; /** * @description Converts radians to degrees. * * @category Camera */ export declare function rad2deg(rad: number): number;