From 7172ce867e3df37e09aa29ddd7102de8004057ea Mon Sep 17 00:00:00 2001 From: michealroberts Date: Mon, 12 Oct 2026 06:54:29 +0000 Subject: [PATCH] feat: add MINUTES_IN_DAY to constants module in @observerly/astrometry feat: add MINUTES_IN_DAY to constants module in @observerly/astrometry --- src/constants.ts | 9 +++++++++ src/index.ts | 1 + tests/constants.spec.ts | 19 ++++++++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index af48928..34de340 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -46,6 +46,15 @@ export const SECONDS_IN_DAY = 86400 /*****************************************************************************************************************/ +/** + * + * The number of minutes in a mean solar day of 86,400 seconds. + * + */ +export const MINUTES_IN_DAY = 1440 + +/*****************************************************************************************************************/ + export const SECONDS_IN_YEAR = 31556925.445 /*****************************************************************************************************************/ diff --git a/src/index.ts b/src/index.ts index 56b8a22..745d42f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -87,6 +87,7 @@ export { J1900, J1970, J2000, + MINUTES_IN_DAY, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_YEAR, diff --git a/tests/constants.spec.ts b/tests/constants.spec.ts index f01ee8d..d7dee79 100644 --- a/tests/constants.spec.ts +++ b/tests/constants.spec.ts @@ -10,7 +10,24 @@ import { describe, expect, it } from 'vitest' /*****************************************************************************************************************/ -import { TWO_PI } from '../src/constants' +import { MINUTES_IN_DAY, SECONDS_IN_DAY, TWO_PI } from '../src/constants' + +/*****************************************************************************************************************/ + +describe('MINUTES_IN_DAY', () => { + it('should be defined', () => { + expect(MINUTES_IN_DAY).toBeDefined() + }) + + it('should be the number of minutes in a mean solar day', () => { + expect(MINUTES_IN_DAY).toBe(1440) + expect(MINUTES_IN_DAY).toBe(24 * 60) + }) + + it('should be the number of seconds in a day in minutes', () => { + expect(MINUTES_IN_DAY).toBe(SECONDS_IN_DAY / 60) + }) +}) /*****************************************************************************************************************/