Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small additional improvements to orbit calculation #4784

Merged
merged 1 commit into from
Feb 2, 2020

Conversation

Gliese852
Copy link
Contributor

Sorry for not noticing this right away. When the ship takes off from the planet, the eccentricity of its orbit is for some time in the range 0.9999 .. 1 and turns into a hyperbole 1.0001. The velocity vector is directed from the planet, so a line is drawn that goes from the ship to infinity. It is not right. These changes solve the problem.
Everything seems to be taken into account now. Feel free to kick.

Changes explained

Was:

orbit with 0.9999 < e < 1.0001 forced to e = 1.0001 (hyperbola)

Now:

orbit with 0.9999 < e < 1 forced to e = 0.9999 (ellipse)
orbit with 1 <= e < 1.0001 forced to e = 1.0001 (hyperbola)

In an elliptical orbit, when the eccentricity is fixed at 0.9999, and
the speed increases, the semi-major axis shrinks and the apocenter moves
toward the star. Therefore, a condition check has been added that prevents
the ship from shifting in this case.

Was: orbit with 0.9999 < e < 1.0001 forced to e = 1.0001 (hyperbola)
Now: orbit with 0.9999 < e < 1      forced to e = 0.9999 (ellipse)
     orbit with 1   <=   e < 1.0001 forced to e = 1.0001 (hyperbola)

In an elliptical orbit, when the eccentricity is fixed at 0.9999, and
the speed increases, the semi-major axis shrinks and the apocenter moves
toward the star. Therefore, a condition check has been added that prevents
the ship from shifting in this case.
@impaktor
Copy link
Member

impaktor commented Feb 1, 2020

Cool

Btw, it looks like github doesn't understand who the author of your commit is, i.e. it's not linking your github account with the commits, might be differently set name in your ~/.gitconfig - doesn't matter, so long as you're fine with it.

@Web-eWorks Web-eWorks merged commit 420a445 into pioneerspacesim:master Feb 2, 2020
@Gliese852 Gliese852 deleted the ellipse-again branch February 3, 2020 20:45
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.

3 participants