Skip to content

Commit 43f6a73

Browse files
Merge pull request #408 from observerly/refactor/constants/EARTH_RADIUS
refactor: amend EARTH_RADIUS in constants module in @observerly/astrometry
2 parents 0c815b9 + fc73d0f commit 43f6a73

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* The approximateed average radius of the Earth in meters.
1212
*
1313
*/
14-
export const EARTH_RADIUS = 6.378e6 as const
14+
export const EARTH_RADIUS = 6.3781378e6 as const
1515

1616
/*****************************************************************************************************************/
1717

tests/observer.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('getLocalHorizon', () => {
3333
})
3434

3535
it('should return a sensible value for an observer at altitude, h, 1000m (with no refraction correction)', () => {
36-
expect(getLocalHorizon(elevation + 1000, 0)).toBe(1.0146012026926674)
36+
expect(getLocalHorizon(elevation + 1000, 0)).toBeCloseTo(1.0146012026926674)
3737
})
3838

3939
it('should return a sensible value for an observer at 1000m (with no refraction correction)', () => {
@@ -44,7 +44,7 @@ describe('getLocalHorizon', () => {
4444
elevation: 1000
4545
}
4646

47-
expect(getLocalHorizon(observer, 0)).toBe(1.0146012026926674)
47+
expect(getLocalHorizon(observer, 0)).toBeCloseTo(1.0146012026926674)
4848
})
4949

5050
it('should return a sensible value for an observer at altitude, h, 1000m', () => {

0 commit comments

Comments
 (0)