SDK Question Barycenter velocity?

Ajaja

Active member
Joined
Apr 20, 2008
Messages
179
Reaction score
49
Points
28
How to get barycenter velocity? I need it for calculation of Lagrange points for planets. oapiGetBarycentre returns position only :(
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,318
Reaction score
20
Points
113
Location
Sydney, Australia
If the primary body you are interested supports ephemeris calculation (all the major bodies in Orbiter do) then you can get the barycentre velocity by calling the planets clbkEphemeris function.

EDIT: If the body doesn't support ephemeris calculation you can get an ordered list of bodies (see this thread for ideas on how to do that) then calculate the barycentre velocity from the mass and velocity of the parent object and all its children:
 

Ajaja

Active member
Joined
Apr 20, 2008
Messages
179
Reaction score
49
Points
28
If the primary body you are interested supports ephemeris calculation (all the major bodies in Orbiter do) then you can get the barycentre velocity by calling the planets clbkEphemeris function.
For Earth clbkEphemeris/clbkFastEphemeris return only EPHEM_TRUEPOS|EPHEM_TRUEVEL|EPHEM_POLAR. Not EPHEM_BARYPOS/EPHEM_BARYVEL
:(

EDIT: If the body doesn't support ephemeris calculation you can get an ordered list of bodies (see this thread for ideas on how to do that) then calculate the barycentre velocity from the mass and velocity of the parent object and all its children:
Thanks! I'll go this way.

But, if oapiGetBarycentre is here, why is there not some oapiGetBarycentreVel function in SDK?
 
Last edited:

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,318
Reaction score
20
Points
113
Location
Sydney, Australia
But, if oapiGetBarycentre is here, why is there not some oapiGetBarycentreVel function in SDK?
I think there is only one man who can answer that question... Martin S.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
0
Location
Hampshire, UK
Website
orbiter.quorg.org
For Earth clbkEphemeris/clbkFastEphemeris return only EPHEM_TRUEPOS|EPHEM_TRUEVEL|EPHEM_POLAR. Not EPHEM_BARYPOS/EPHEM_BARYVEL
:(


Thanks! I'll go this way.

But, if oapiGetBarycentre is here, why is there not some oapiGetBarycentreVel function in SDK?
I had the same problem when updating the TransX code. I had to write my own function to get the barycentric velocity by the method mentioned above.
 
Top