···2828}
29293030/**
3131+ * Constant to multiply the zodiac index with to get the angle in degrees.
3232+ * Starting with Aries at 0°.
3333+ */
3434+const zodiacDegreeFactor = 30;
3535+3636+/**
3737+ * Return the angle in degrees of the given zodiac, starting with aries at 0.
3838+ * @param z The zodiac to get the angle of.
3939+ * @returns The angle in degrees of the given zodiac, starting with aries at 0.
4040+ */
4141+export function zodiacDegrees(z: Zodiacs): number {
4242+ return z * zodiacDegreeFactor;
4343+}
4444+4545+/**
3146 * The name of the 12 zodiac sign in slovak.
3247 */
3348const zodiacSlovak = [
···5772/**
5873 * The Unicode symbols of the 12 zodiac signs.
5974 */
6060-export const zodiacSymbols = [
7575+const zodiacSymbols = [
6176 "♈",
6277 "♉",
6378 "♊",
···8095export function zodiacSymbol(z: Zodiacs): string {
8196 return zodiacSymbols[z];
8297}
9898+9999+/**
100100+ * A angle given in zodiac signs, degrees and minutes.
101101+ * `z` is angle in as a zodiac sign, the angle in 30° increments,
102102+ * `degrees` is the remainder of the angle in degrees should be between 0 and 30
103103+ * (exclusive),
104104+ * `minutes` is the remainder of the angle in minutes.
105105+ */
106106+export type ZodiacAngle = {
107107+ // eslint-disable-next-line lines-around-comment
108108+ /**
109109+ * The zodiac sign of the angle. This is a angle in 30° increments.
110110+ */
111111+ z: Zodiacs;
112112+113113+ /**
114114+ * The part of the angle in degrees, should be between 0 and 30 (exclusive).
115115+ */
116116+ degrees: number;
117117+118118+ /**
119119+ * The part of the angle in minutes, should be between 0 and 59 (exclusive).
120120+ * A minute is 1/60 of a degree.
121121+ */
122122+ minutes: number;
123123+};
124124+125125+/**
126126+ * Return a string representation of the given `ZodiacAngle`.
127127+ * @param a The `ZodiacAngle` to convert to a string.
128128+ * @returns The string representation of the given `ZodiacAngle`.
129129+ */
130130+export function zodiacAngleString(a: ZodiacAngle): string {
131131+ return `${zodiacString(a.z)} ${a.degrees}°${a.minutes}'`;
132132+}
133133+134134+/**
135135+ * Return the angle in degrees of the given `ZodiacAngle`.
136136+ * @param a The `ZodiacAngle` to convert to degrees.
137137+ * @returns The angle in degrees of the given `ZodiacAngle`.
138138+ */
139139+export function zodiacAngle2Deg(a: ZodiacAngle): number {
140140+ // eslint-disable-next-line no-magic-numbers
141141+ return (a.z * zodiacDegreeFactor + a.degrees + a.minutes / 60) % 360;
142142+}
143143+144144+/**
145145+ * Return the `ZodiacAngle` of the given angle in degrees.
146146+ * @param angle The angle in degrees to convert to a `ZodiacAngle`.
147147+ * @returns The `ZodiacAngle` of the given angle in degrees.
148148+ */
149149+export function deg2ZodiacAngle(angle: number): ZodiacAngle {
150150+ // eslint-disable-next-line no-magic-numbers
151151+ const z = Math.floor(angle / zodiacDegreeFactor) % 12;
152152+ const degrees = Math.floor(angle % zodiacDegreeFactor);
153153+ // Round two times, once to a factor of ten and then round again after / 10.
154154+ const minutes = Math.round(
155155+ // eslint-disable-next-line no-magic-numbers, @typescript-eslint/no-extra-parens
156156+ Math.round(((angle - (z * zodiacDegreeFactor + degrees)) * 600) % 600) *
157157+ // eslint-disable-next-line no-magic-numbers
158158+ 0.1,
159159+ );
160160+ return { z, degrees, minutes };
161161+}
162162+163163+/**
164164+ * Return the bisection of the angle between the two given `ZodiacAngle`s.
165165+ * @param a The first `ZodiacAngle` of the angle to bisect.
166166+ * @param b The second `ZodiacAngle` of the angle to bisect.
167167+ * @returns The bisection of the angle between the two given `ZodiacAngle`s.
168168+ */
169169+export function bisectZodiacAngle(a: ZodiacAngle, b: ZodiacAngle): ZodiacAngle {
170170+ const aDeg = zodiacAngle2Deg(a);
171171+ const bDeg = zodiacAngle2Deg(b);
172172+ // eslint-disable-next-line no-magic-numbers
173173+ const cDeg = (aDeg + bDeg) * 0.5;
174174+ return deg2ZodiacAngle(cDeg);
175175+}