Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
  • Loading branch information
onekiloparsec committed Oct 29, 2023
1 parent c5c32e8 commit a6523e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/sun.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as juliandays from '@/juliandays'
import * as constants from '@/constants'
import { Sun } from '@/sun.js'
import { Sun } from '@/sun'

describe('sun', () => {
test('get sun geometric longitude mean equinox of the date (AA p.165)', () => {
Expand All @@ -20,19 +20,19 @@ describe('sun', () => {
})


test('get sun apparent equatorial coordinates (AA p.165)', () => {
test('get sun geocentric equatorial coordinates (AA p.165)', () => {
const UTCDate = new Date(Date.UTC(1992, 9, 13))
const jd = juliandays.getJulianDay(UTCDate)
const equ = Sun.getApparentEquatorialCoordinates(jd)
const equ = Sun.getGeocentricEquatorialCoordinates(jd)
expect(equ.rightAscension).toBeCloseTo(13.225389, 3) // accuracy is bad, as in SwiftAA !
expect(equ.declination).toBeCloseTo(-7.78507, 2) // accuracy is bad, as in SwiftAA !
})

test('get another sun apparent equatorial coordinates AA p.343', () => {
const UTCDate = new Date(Date.UTC(1992, 3, 12))
const jd = juliandays.getJulianDay(UTCDate)
const equ = Sun.getApparentEquatorialCoordinates(jd)
expect(equ.rightAscension * constants.H2DEG).toBeCloseTo(20.6579, 3)
const equ = Sun.getGeocentricEquatorialCoordinates(jd)
expect(equ.rightAscension * constants.H2DEG).toBeCloseTo(20.6589, 3)
expect(equ.declination).toBeCloseTo(8.6964, 3)
})

Expand Down

0 comments on commit a6523e1

Please sign in to comment.