Skip to content

Commit

Permalink
fix: 🐛 fix error when argOfPer is 360
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jun 25, 2024
1 parent 0efa851 commit 2f97430
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/coordinate/Tle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ export class Tle {
* @see https://en.wikipedia.org/wiki/Argument_of_perigee
* @example 69.9862
* @param tleLine2 The second line of the Tle to parse.
* @returns The argument of perigee in degrees (0 to 359.9999).
* @returns The argument of perigee in degrees (0 to 360).
*/
static argOfPerigee(tleLine2: TleLine2): Degrees {
const argPe = parseFloat(tleLine2.substring(Tle.argPerigee_.start, Tle.argPerigee_.stop));

if (!(argPe >= 0 && argPe < 360)) {
if (!(argPe >= 0 && argPe <= 360)) {
throw new Error(`Invalid argument of perigee: ${argPe}`);
}

Expand Down Expand Up @@ -628,7 +628,7 @@ export class Tle {
* @see https://en.wikipedia.org/wiki/Mean_Anomaly
* @example 25.2906
* @param tleLine2 The second line of the Tle to parse.
* @returns The mean anomaly of the satellite. (0 to 359.9999)
* @returns The mean anomaly of the satellite. (0 to 360)
*/
static meanAnomaly(tleLine2: TleLine2): Degrees {
const meanA = parseFloat(tleLine2.substring(Tle.meanAnom_.start, Tle.meanAnom_.stop));
Expand Down Expand Up @@ -713,7 +713,7 @@ export class Tle {
* northward (ascending) across the Earth's equator (equatorial plane).
* @example 208.9163
* @param tleLine2 The second line of the Tle to parse.
* @returns The right ascension of the satellite. (0 to 359.9999)
* @returns The right ascension of the satellite. (0 to 360)
*/
static rightAscension(tleLine2: TleLine2): Degrees {
const rightAscension = parseFloat(tleLine2.substring(Tle.rightAscension_.start, Tle.rightAscension_.stop));
Expand Down

0 comments on commit 2f97430

Please sign in to comment.