How does OrbitMFD calculate in real time?

george7378

DON'T PANIC
Addon Developer
Donator
Joined
Jun 26, 2009
Messages
1,045
Reaction score
0
Points
36
Does anyone know how OrbitMFD calculates all the values it displays, specifically apoapsis, periapsis and orbital period?

I know that if you use the formula for an ellipse to define your orbit, there are easy ways to determine the properties of it (such as 'r(a)=a(1+e)' and 'r(p)=a(1-e)', etc...) but since Orbiter uses nothing but gravitational forces to propagate the orbit in real time, those formulae won't work.

I guess you could do it using energy, but I'm not really sure how you'd go about that either.

Thanks.
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
You can look directly at one method of doing OrbitMFD's work with the sources here:
[ame="http://www.orbithangar.com/searchid.php?ID=3609"]Free Orbit MFD 1.2[/ame]
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Does anyone know how OrbitMFD calculates all the values it displays, specifically apoapsis, periapsis and orbital period?

I know that if you use the formula for an ellipse to define your orbit, there are easy ways to determine the properties of it (such as 'r(a)=a(1+e)' and 'r(p)=a(1-e)', etc...) but since Orbiter uses nothing but gravitational forces to propagate the orbit in real time, those formulae won't work.

Open your API_Reference.pdf, in Orbitersdk\doc. Page 571 has the info about orbital mechanics in general.

Look also for the structs ELEMENTS and ORBITPARAM and function GetElements.

If you're thinking about programming for Orbiter, than API_Reference.pdf has become your new best friend.


I guess you could do it using energy, but I'm not really sure how you'd go about that either.

Thanks.

Not enough, actually. Think about it, energy can tell you how fast you're going and how high (no pun intended) you are, but it doesn't tell you anything about the direction. You could have 8 km/s velocity and 200 km altitude, but you could be travelling in any direction and still have the same energy.
 
Top