Last active
August 29, 2015 14:24
-
-
Save ChrisAndre/1fcf1b8555af979a4a57 to your computer and use it in GitHub Desktop.
NaN issue
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 PyKEP | |
import random | |
import math | |
r_ang = random.uniform(0, math.pi * 2) | |
rx = math.cos(r_ang) | |
ry = math.sin(r_ang) | |
rz = 0 | |
vx = -math.sin(r_ang) | |
vy = math.cos(r_ang) | |
vz = random.uniform(0, 1) | |
r = [rx, ry, rz] # mag = 1.0 | |
v = [vx, vy, vz] # ~1.4 > mag > 1.0 | |
mu = 1 | |
s = PyKEP.planet.keplerian(PyKEP.epoch(0), r, v, mu, 0, 1, 2) | |
print 'Elements: %5.5f, %5.5f, %5.5f, %5.5f, %5.5f, %5.5f' % (s.orbital_elements) | |
print ' -> R(0): %3.3f, %3.3f, %3.3f' % (s.eph(PyKEP.epoch(0))[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment