Jump to content

Orbit angle


Aniruddh

Recommended Posts

I'm writing a program that finds the distance between two spacecraft in ksp using the cosine rule. This is a quick question about orbital elements- which orbital element denotes the current angle of the planet/spacecraft around the orbit? Is that the mean anomaly? Thanks.

Link to comment
Share on other sites

4 minutes ago, RealKerbal3x said:

@Aniruddh Isn't it the inclination? Unless I'm misinterpreting your question.

Inclination is the orbital equivalent of latitude, the one I'm looking for is the orbital equivalent for current longitude of the spacecraft. I'll try find a diagram to make it clearer.

Link to comment
Share on other sites

Referring you to everyone's favorite wikipedia graphic...

600px-Orbit1.svg.png

I believe what you want (for comparing two bodies in different orbits) is the longitude of the ascending node plus the argument of periapsis plus the true anomaly. Note that I believe some of those are in degrees while others are in radians, so some conversion is needed.

https://github.com/HebaruSan/Astrogator/blob/9e27f1e9653ed6cee22a36934eb24df81a6a976b/src/PhysicsTools.cs#L135-L164

Link to comment
Share on other sites

The Wikipedia graphic is really good! For some reason I didn't realise that orbits are 3d, which means I'd have to use multiple angles rather than a single angle. I just found out the game uses vectors as well which are easier to use than angles & the cosine rule, to find distances in 3d between 2 vessels.

I might still have to use the cosine rule later in the plugin I'm creating, but for now I'm good. Thank you all for the explanations.

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...