Skip to content

Commit

Permalink
Merge pull request #408 from observerly/refactor/constants/EARTH_RADIUS
Browse files Browse the repository at this point in the history
refactor: amend EARTH_RADIUS in constants module in @observerly/astrometry
  • Loading branch information
michealroberts authored Jan 22, 2025
2 parents 0c815b9 + fc73d0f commit 43f6a73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* The approximateed average radius of the Earth in meters.
*
*/
export const EARTH_RADIUS = 6.378e6 as const
export const EARTH_RADIUS = 6.3781378e6 as const

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

Expand Down
4 changes: 2 additions & 2 deletions tests/observer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('getLocalHorizon', () => {
})

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

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

expect(getLocalHorizon(observer, 0)).toBe(1.0146012026926674)
expect(getLocalHorizon(observer, 0)).toBeCloseTo(1.0146012026926674)
})

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

0 comments on commit 43f6a73

Please sign in to comment.