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

Time to launch into Minimus LAN is slightly off #2

Open
quetschke opened this issue Apr 25, 2021 · 6 comments
Open

Time to launch into Minimus LAN is slightly off #2

quetschke opened this issue Apr 25, 2021 · 6 comments

Comments

@quetschke
Copy link

Hi Mike,
in MinmusLaunchTime.ks you correct for the position on the sidereal orbit by:
360*((TIME:DAY-1) / 426
This should be 9203545/21600 = 426.090046 instead of 426. (Kerbals need leap minutes ...)

Only a 0.02% correction, but Kerbals will thank you in a thousand years to hit Minmus' orbit at the right inclination.

@quetschke quetschke changed the title Minimus LAN is slightly off Time to launch into Minimus LAN is slightly off Apr 25, 2021
@quetschke
Copy link
Author

I'm sorry, always test code before suggesting patches ...
TIME:DAY is an integer, so what I suggest instead is to use:
360*((TIME:SECONDS) / 9203545)
to correct for the correct position on the orbit with the sidereal orbital period of 9203545 s.

@MikeAben64
Copy link
Owner

MikeAben64 commented Apr 25, 2021 via email

@MikeAben64
Copy link
Owner

MikeAben64 commented Apr 25, 2021 via email

@quetschke
Copy link
Author

quetschke commented Apr 25, 2021

You are correct, I noticed that and was pondering if I should leave another comment. I actually decided to make it even more accurate to calculate the time from now to the next AN (or DN) including sidereal correction. And then warp there and inc;lude this in my launch script. (Note, I didn't hard-code Minmus, but take a generic LAN parameter.)
LauLAN.ks.txt

@quetschke
Copy link
Author

quetschke commented Apr 25, 2021

We should move this to the discord. I think for your code, you need to do

360*((ROUND(TIME:SECONDS/21600,0)*21600) / 9203545)

because you want to have the sidereal correction for every day that has passed.

Never mind, I think that is exactly what your code does, just modulo the 360 degrees.

@quetschke
Copy link
Author

One more comment though, by using TIME:SECONDS for the calculation of the sidereal correction, one corrects until "right now". Your original code only corrects until 0:00, the beginning of the day. The difference is negligible, but not the same. The LauLAN script from above corrects until the actual launch time, but that's just me and total overkill.

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

No branches or pull requests

2 participants