Skip to content

Commit

Permalink
fix: 🐛 fix bug in how alpha 5 was calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Nov 13, 2023
1 parent 92e14a1 commit c36cd0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sgp4/sgp4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,7 @@ class Sgp4 {
*/
const leadingChar = satn.split('')[0].toLowerCase(); // Using uppercase will break the -96 math.

if (isNaN(parseInt(leadingChar))) {
if (isNaN(parseInt(leadingChar)) && leadingChar !== ' ') {
satrec.satnum = parseInt(leadingChar.charCodeAt(0) - 96 + 9 + satrec.satnum.slice(1, 5)).toString();
} else {
satrec.satnum = satn;
Expand Down

0 comments on commit c36cd0c

Please sign in to comment.