From 5581a18ffcb7ebbc04365e36fe49b51534c99137 Mon Sep 17 00:00:00 2001 From: Theodore Kruczek Date: Fri, 12 Jan 2024 22:00:24 -0500 Subject: [PATCH] refactor: :recycle: standardize eci and rae methods --- src/objects/Star.ts | 6 +++--- test/objects/star.test.ts | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/objects/Star.ts b/src/objects/Star.ts index 40e9adb..df98743 100644 --- a/src/objects/Star.ts +++ b/src/objects/Star.ts @@ -65,15 +65,15 @@ export class Star extends BaseObject { this.vmag = info.vmag; } - getEci(lla: LlaVec3 = { lat: 180, lon: 0, alt: 0 }, date: Date = this.time): EciVec3 { - const rae = this.getRae(lla, date); + eci(lla: LlaVec3 = { lat: 180, lon: 0, alt: 0 }, date: Date = this.time): EciVec3 { + const rae = this.rae(lla, date); const { gmst } = Star.calculateTimeVariables_(date); // Arbitrary distance to enable using ECI coordinates return ecf2eci(rae2ecf(rae, { lat: 0, lon: 0, alt: 0 }), gmst); } - getRae( + rae( lla: LlaVec3 = { lat: 180, lon: 0, alt: 0 }, date: Date = this.time, ): RaeVec3 { diff --git a/test/objects/star.test.ts b/test/objects/star.test.ts index da64210..2ca9305 100644 --- a/test/objects/star.test.ts +++ b/test/objects/star.test.ts @@ -4,8 +4,7 @@ * @since 3.0.0 */ -import { Degrees, Kilometers, Radians } from '../../lib/index'; -import { Star } from '../../lib/objects'; +import { Degrees, Kilometers, Radians, Star } from '../../lib/index'; describe('Basic Star functionality', () => { const star = new Star({ @@ -15,7 +14,7 @@ describe('Basic Star functionality', () => { }); it('should be able to get rae coordinates', () => { - const rae = star.getRae( + const rae = star.rae( { lat: 0, lon: 0, @@ -30,7 +29,7 @@ describe('Basic Star functionality', () => { }); it('should be able to get ECI coordinates', () => { - const eci = star.getEci( + const eci = star.eci( { lat: 0, lon: 0,