Jump to content

Converting orbit data formats (peri/aps/inc to sma/ecc/inc/lpe/lan etc)


tjsnh

Recommended Posts

So I've got a project I'm working on and need some conversion assistance.

Long story short - custom contracts to put things in specific orbits. In order to get the orbital profiles to show up in the big-picture "M" view I need to define them in the following format:

(This is just some example data)

SMA = 1449999.99996286
ECC = 1.07570816555399E-05
INC = 0
LPE = 270.690311604893
LAN = 1.93635924563296
MNA = 1.55872660382504
EPH = 31.3999999999994
REF = 1

Which, I believe, is how the save file stores them?

What I have now for the orbits (which I have on paper) is more basic :

Apo 200km
Peri 640km
Incl 13
Ecc 0.04

Most of the other values (like where over the body the periaps is, etc) are unimportant for my purposes.

I've had a small amount of luck using hyperedit (as suggested by nightinggale), which can at least print these values out for me on the screen, but I haven't had a lot of luck figuring out how to plug simple aps/peri/inc/ecc info into hyperedit to throw something into that specific orbit THEN get the more verbose stats. I realize hyperedit might not have that capability.

Anyone have any advice on the best way to do this sort of conversion?

Link to comment
Share on other sites

Apo and Peri might need to not be above sea level. Unless they aren't in your data...

SMA is the average of the two apses from the point mass.

The data I have is all ASL as-presented in game/stock currently - but I could convert them to being from Kerbin's center of mass with basic arithmetic.

I run into some confusion with the Semi-Major Axis. The explanations I've seen on how to calculate it all end up with circular orbits as they only measure one vector to the periaps, so I must be missing something.

- - - Updated - - -

Any other mods or add-ons that make this simpler?

Edited by tjsnh
Link to comment
Share on other sites

INC and ECC are just the same.

SMA would be (Apo + Peri + 1200) * 500

Which accounts for the fact that yours are ASL values and in KM, where the games values are in meters and from the center.

LPE is what the game calls Argument of Periapsis IIRC, so the angle in degrees between the ascending node and the Periapsis.

LAN is the angle between the Ascending node and some arbitrary celestial reference point (again in degrees), so it is pretty hard to do anything with unless you already know what you want.

MNA is mean anomaly at epoch, So how far around the orbit you are at a given point in time (defined by EPH), this time it is in Radians. Should not really matter.

REF is the body you are orbiting.

Link to comment
Share on other sites

Anyone have any advice on the best way to do this sort of conversion?

Take a look here: https://en.wikipedia.org/?title=Orbital_elements

- - - Updated - - -

SMA would be (Apo + Peri + 1200) * 500

Which accounts for the fact that yours are ASL values and in KM, where the games values are in meters and from the center.

What's 500?

Correct formula is this: SMA = (Ap + Pe + 2* RefBodyRadius) / 2. The result will be in same units as input values are.

Link to comment
Share on other sites

INC and ECC are just the same.

SMA would be (Apo + Peri + 1200) * 500

Which accounts for the fact that yours are ASL values and in KM, where the games values are in meters and from the center.

LPE is what the game calls Argument of Periapsis IIRC, so the angle in degrees between the ascending node and the Periapsis.

LAN is the angle between the Ascending node and some arbitrary celestial reference point (again in degrees), so it is pretty hard to do anything with unless you already know what you want.

MNA is mean anomaly at epoch, So how far around the orbit you are at a given point in time (defined by EPH), this time it is in Radians. Should not really matter.

REF is the body you are orbiting.

Thank you! Great explanation.

So for an orbit with Apo 600, peri 200, the SMA will be 1000000 ?

There are a lot of values that could add up to an SMA of 1000000, how will the game determine the aps/peri from that?

Or is that where LPE comes in? (and if so, anyone how to extrapolate it? I'm not scared of the math if needed)

(LAN, MNA won't be important)

Hyperedit gives the REF value for the bodies, so that's easy to extract.

Link to comment
Share on other sites

INC and ECC are just the same.

SMA would be (Apo + Peri + 1200) * 500

Which accounts for the fact that yours are ASL values and in KM, where the games values are in meters and from the center.

LPE is what the game calls Argument of Periapsis IIRC, so the angle in degrees between the ascending node and the Periapsis.

LAN is the angle between the Ascending node and some arbitrary celestial reference point (again in degrees), so it is pretty hard to do anything with unless you already know what you want.

MNA is mean anomaly at epoch, So how far around the orbit you are at a given point in time (defined by EPH), this time it is in Radians. Should not really matter.

REF is the body you are orbiting.

INC is inclination while ECC appears to be eccentricity. It is useful for acquiring the Apoapsis, Periapsis, and even Semi minor axis from the semi major axis.

- - - Updated - - -

Thank you! Great explanation.

So for an orbit with Apo 600, peri 200, the SMA will be 1000000 ?

There are a lot of values that could add up to an SMA of 1000000, how will the game determine the aps/peri from that?

Or is that where LPE comes in? (and if so, anyone how to extrapolate it? I'm not scared of the math if needed)

(LAN, MNA won't be important)

Hyperedit gives the REF value for the bodies, so that's easy to extract.

You're looking for eccentricity of the orbit.

- - - Updated - - -

Take a look here: https://en.wikipedia.org/?title=Orbital_elements

- - - Updated - - -

What's 500?

Correct formula is this: SMA = (Ap + Pe + 2* RefBodyRadius) / 2. The result will be in same units as input values are.

That's half of 1000. From the conversion to meters.

Link to comment
Share on other sites

Great, thanks folks.

This will give me something to experiment with this evening and see if I can get a process down for doing these conversions (I have several thousand to do - my hope is to make a spreadsheet or code up a simple C app to do the math for me once I have a process sorted out that will give me at least semi-accurate conversions)

Link to comment
Share on other sites

Thank you! Great explanation.

So for an orbit with Apo 600, peri 200, the SMA will be 1000000 ?

There are a lot of values that could add up to an SMA of 1000000, how will the game determine the aps/peri from that?

Or is that where LPE comes in? (and if so, anyone how to extrapolate it? I'm not scared of the math if needed)

(LAN, MNA won't be important)

Hyperedit gives the REF value for the bodies, so that's easy to extract.

Apoapsis and Periapsis are determined by the Semi-Major Axis and the Eccentricity. Periapsis = (1-e)a, while apoapsis is (1+e)a

What's 500?

1000/2

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