Jump to content

Find topocentric (kerbin) coordinates for celestial bodies


marcusdb

Recommended Posts

Is there any API call that given Ksp launch pad coordinates I can find the relative position for other celestial bodies?

The reason is that if I am to plan a launch inclination (to intercept an asteroid for instance) I need to know to where in space  launch pad is pointing at (it's normal vector ) and it's current angle related to the body/target I am interested.

Any Ideas?

Link to comment
Share on other sites

9 hours ago, marcusdb said:

Is there any API call that given Ksp launch pad coordinates I can find the relative position for other celestial bodies?

The reason is that if I am to plan a launch inclination (to intercept an asteroid for instance) I need to know to where in space  launch pad is pointing at (it's normal vector ) and it's current angle related to the body/target I am interested.

Any Ideas?

No idea about API, but for an inclined launch to a taeget, you can use the Rendez-vous planner from MechJeb. Set your target and you'll have your relative inclination in real time, so you can choose the right moment to launch.

Link to comment
Share on other sites

16 minutes ago, Nansuchao said:

No idea about API, but for an inclined launch to a taeget, you can use the Rendez-vous planner from MechJeb. Set your target and you'll have your relative inclination in real time, so you can choose the right moment to launch.

I think he's programming his own mod which needs to determine the right moment to launch.

Link to comment
Share on other sites

3 hours ago, Nansuchao said:

Probably you're right, he can however take a look at MechJeb code to have an idea of what to do.

Thank you guys for replying.

I am indeed developing my own mod (for asteroid interception) 
I will check MechJeb source code (even though I am not sure if MechJeb has such functionality), but let me give you guys a better idea of what I am looking for..

It's fine and easy to find out all celestial bodies positions at any point in time right, so for instance I can find where Kerbin is going to be at a given epoch (date+hour) related to the other bodies, but I cannot figure it out to where the launch pad will be facing at that epoch.
One possible solution is to find out to were the launch pad was pointing at epoch zero (it is still going to be a challenge finding out where the launch pad was pointing/facing that day) and then do the planet rotation math to find out where the launch pad will be pointing at in the future, that can be done for sure but I guess there must be something done already.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...