Created
July 18, 2017 18:33
-
-
Save djungelorm/371a8b075e75b081b3c366fb31125fef to your computer and use it in GitHub Desktop.
Script for testing orbital parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import krpc | |
import time | |
import math | |
conn = krpc.connect() | |
vessel = conn.space_center.active_vessel | |
orbit = vessel.orbit | |
ut = conn.add_stream(getattr, conn.space_center, 'ut') | |
def rad_to_deg(rad): | |
return rad * (180.0/math.pi) | |
while True: | |
print 'true anomaly: %.1f, %.1f' % \ | |
(rad_to_deg(orbit.true_anomaly), | |
rad_to_deg(orbit.true_anomaly_at_ut(ut()))) | |
print ' ecc anomaly: %.1f, %.1f' % \ | |
(rad_to_deg(orbit.eccentric_anomaly), | |
rad_to_deg(orbit.eccentric_anomaly_at_ut(ut()))) | |
print 'mean anomaly: %.1f' % \ | |
rad_to_deg(orbit.mean_anomaly) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment