Skip to content

from_state_vector: Fix some angular values returning 2*pi instead of 0#46

Open
mgiuca wants to merge 2 commits into
RazerM:masterfrom
mgiuca:from_state_vector-mod-2pi
Open

from_state_vector: Fix some angular values returning 2*pi instead of 0#46
mgiuca wants to merge 2 commits into
RazerM:masterfrom
mgiuca:from_state_vector-mod-2pi

Conversation

@mgiuca
Copy link
Copy Markdown
Contributor

@mgiuca mgiuca commented Sep 16, 2025

When negating an angle, consistently use mod 2pi instead of adding 2pi. This causes 0 to remain as 0 instead of becoming 2pi.

Intended to be based on top of PR #45.

Adds a missing check for the case where the eccentricity vector is in the third
or fourth quadrant, requiring arg_pe to be negated.

Note that this causes an edge case where arg_pe should be 0° but it comes out as
360° because we are not using modulo, but rather adding 2*pi. I didn't want to
fix that in this commit because all the calculations in from_state_vector behave
the same way.

Fixes RazerM#39.
When negating an angle, consistently use mod 2*pi instead of adding 2*pi. This
causes 0 to remain as 0 instead of becoming 2*pi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant