Perigee and Apogee

santy86

New member
Joined
Apr 22, 2008
Messages
114
Reaction score
0
Points
0
Location
Amsterdam
Hi guys,

Do you know how to retrieve the Apogee and perigee height (from earth surface) ???

Thanks

Maybe this evening the INT-21 (my first add-on) will be released

:cheers:
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,661
Reaction score
2,382
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Hi guys,

Do you know how to retrieve the Apogee and perigee height (from earth surface) ???

Retrieve from where? ;) Orbiters SDK? From the state vector of a vessel? Or by looking into Orbit MFD?

And yes: It is Apoapsis and periapsis unless you are interested into a special celestial body like Earth. So, if you are interested into the apogee of a probe orbiting mars, most sane people will tell you the apoareion (the apoapsis of Mars). Correct people might feel compelled to give you hints how to calculate the osculating elements of this probe relative to Earth and how to calculate the apogee of these osculating elements. :cheers:
 

santy86

New member
Joined
Apr 22, 2008
Messages
114
Reaction score
0
Points
0
Location
Amsterdam
Sorry, maybe I was a not precise enough and, yes i ment Apoapsis and Periapsis retrieval from orbiter SDK. But it was just a question. No compulsory answer or explanation :)

Thanks anyway
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,661
Reaction score
2,382
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
You have two options: Just retrieve the current Kepler elements by using "GetElements()". And work with the values of these. Or calculate these elements yourself by using the state vector (velocity and position relative to Earth).

When you have the elements, you can calculate apoapsis and periapsis distance. The next step for apsis distance is then subtracting the planet radius below each apsis. Thats simple for a spherical abstraction. And a tiny challenge when you use a WGS-84 ellipsoid.
 

V8Li

Member
Joined
Apr 9, 2008
Messages
200
Reaction score
0
Points
16
Variables used:
Code:
double ApA, PeA;
[SIZE=2]VESSEL *v;[/SIZE]
ApA:
Code:
[SIZE=2]OBJHANDLE hBody=NULL;[/SIZE]
[SIZE=2]hBody = v->GetSurfaceRef();[/SIZE]
[SIZE=2]v->GetApDist(ApA);[/SIZE]
[SIZE=2]ApA -=oapiGetSize(hBody);[/SIZE]
PeA:
Code:
[SIZE=2]OBJHANDLE hBody=NULL;[/SIZE]
[SIZE=2]hBody = v->GetSurfaceRef();[/SIZE]
[SIZE=2]v->GetPeDist(PeA);[/SIZE]
[SIZE=2]PeA -=oapiGetSize(hBody);[/SIZE]
v is the vessel, initialize it somewhere in your code using this line:
Code:
v = oapiGetFocusInterface();
before using it.

It really helps checking the API_Reference.pdf and reading other source codes from other MFDs, modules, etc.
 

santy86

New member
Joined
Apr 22, 2008
Messages
114
Reaction score
0
Points
0
Location
Amsterdam
Thanks a lot to all guys of this forum for the help given to me, that allowed me to finish my first add-on and to increase my interests in orbiter.

:speakcool:

Santy
 
Top