Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*****************************************************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export {
J1900,
J1970,
J2000,
MINUTES_IN_DAY,
SECONDS_IN_DAY,
SECONDS_IN_HOUR,
SECONDS_IN_YEAR,
Expand Down
19 changes: 18 additions & 1 deletion tests/constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})

/*****************************************************************************************************************/

Expand Down
Loading