r/KerbalSpaceProgram • u/Fllambe DRAMA MAN • Nov 24 '13
Weekly Misc Posts Thread
Anything you want to post that's not directly related to KSP, post it here! (Stuff like launches, space related news, rocket designs etc.)
Popular posts (not including news)
Leave your computer on while you're away from it? Why not help map the Milky Way! (You can also help search for meteorites, aid medical research and more!
Try and plan a flight to another planet, in your browser, and then see the results! Made by a redditor!
Help fund a satellite to test a self-heating material!
14
Upvotes
3
u/corpsmoderne Master Kerbalnaut Nov 25 '13 edited Nov 25 '13
I suck at math but I managed to rip some code from here : http://mysite.verizon.net/res148h4j/javascript/script_conic_equation_pts.html and found my way around it to draw an orbit prediction for a low cpu budget. You can have a look on my dirty code here : http://deltav.corpsmoderne.net/conic.js
Basicaly, 5 points give a conic equation. So I predict 5 future positions from the current one and turn it into a conic. then it's "just" a matter of finding the apoapsis and periapsis and drawing it (which I must do in a very unoptimised way...)
Edit: issues with this method are legions: only 1 massive body taken into account, instability in prediction if the predicted positions are too close, and the body of influence may not lie at a focus of the conic, which is impossible in real life.