# What's the best way to understand different relative coordinate systems?

• Topocentric (From a local observer on the surface, not the center)
• Geocentric (From the center of a celestial body)
• Perifocal (From the terms of an orbit (?) unsure 2D only?)
• I'm sure I've missed plenty here, please enlighten me to the most commonly used inertial frames for space exploration...

Do all frames basically have an "observer" which is looking at the "target" object where we express the state vectors of the target in terms of the observer? Am I over-complicating this? I am just totoally at a loss on how to implement "frames" in terms of objects in code.

By looking at KSP it seems that for different functions, different frames are used to describe the motion of the particle, for instance, when targeting another body with your craft (the observer) you get relative measurements of the distance between yourself and the target. This is kind-of my overall goal here, allowing 2 particles to easily switch between inertial frames to get relative data in terms of the observer by passing the frame itself to the particle.

Despite all my rambling above, I suppose my true question is:

When do you use which frames of reference and what do each of the frames of reference have in common, how do they differ? What exactly do all frames of references have in common, do all use a "target" object and an "observer" object-- are there any other elements in common between these frames of reference?

I have to admit, my brain hurts when they try to give information in one frame, then ask for information in another. Usually when this is the case I've not grasped the basic understanding of the meaning behind the concept.

If this should be migrated, let me know, I'm fine with physics.SE, thanks.

• A useful example of the different systems used in a real program can be found in "Coordinate Systems for the Space Shuttle Program". Key ones we used in the simulator were M50, structure frame, landing site, nav base, LVLH.... ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19740026178.pdf Oct 3, 2018 at 13:36
• @OrganicMarble don't know how I missed this comment, I'll take a look now :). Ahhhh!!! Thank you! That Glossary is exactly the type of thing I was looking for. A catalog of all useful frames. Honestly I think I've just been using almost all of these frames in my calculations without even realizing it. Except for a few. Oct 4, 2018 at 0:06
• "Geocentric (From the center of a celestial body)" That is wrong, it is from the center of the Earth only. See wikipedia.
– Uwe
Oct 4, 2018 at 10:15

Oh, on the surface you're overcomplicating things. When you dig deeper, specifically for numerical calculations, you're just seeing the top of an iceberg. And bringing KSP up is a good example: numerical precision, especially on interplanetary scales, is a huge problem. KSP deals with many of these problems by resetting the origin of the system of coordinates to the current craft - to reduce the floating point error.

All frames of reference have an origin (usually 'visualized' as immobile observer) and orientation (where the axis point; the observer doesn't rotate relative to them).

Theoretically, all inertial coordinate systems are completely equivalent. In practice, a problem easy in one becomes impossibly hard in another. Never mind often picking a non-inertial coordinate system is better.

For example, neither topocentric nor geocentric is an inertial system. The observer is rotating with the planet surface, and everything in that system experiences the centrifugal force of that rotation. And yet they are a great systems for analyzing atmospheric flight, SSTO/spaceplanes, ascent and reentry, surface navigation etc. Instead of bothering with n-body or such problems, you just 'spawn' fictitious forces that act upon everything in the system following a certain set of rules, and don't bother with quirks of gravity.

Similarly, for a body in orbit, saying the topocentric frame attached to it is inertial is an approximation you can't always afford to make. Tidal forces, trace atmospheric drag, electrodynamic drag, light pressure... and orbital mechanics of anything even somewhat distant from the object or even quite near but over time comparable to the orbital period. Geocentric obviously is never inertial as long as the planet is turning.

The perifocal system will be the first approaching actually being inertial. It still isn't always, but times involved and distances/forces will make the fact the system usually circles the Sun way less significant - if your origin is the planet, but rotation-wise you fix it to "distant stars". It's even more inertial if you affix the origin to the Sun. Then only the galaxy motion spoil its 'inertialness'... unless you dig into general relativity, where the gravity is spacetime curvature instead of 'a mysterious field' and you're all out of being inertial.

These are the three basic classes of coordinate systems in common use. And each of these has countless instances - some of them more "famous" than others.

KSP gives a good intuition how these work. "Surface" is geocentric. "Orbit" is perifocal. "Target" is topocentric. If you try to dock two big things in a low orbit and it takes a long time, non-inertial nature of topocentric soon becomes your annoyance. "Orbit" is the truest... but you won't be happy flying an airplane in that mode. "Surface" - yes, important for landing; instead of matching speed with planet surface, you just reduce the surface speed to zero... but what does your speed relative to Sun surface matter? Each has own purposes, and own limitations.

Now maybe about some more common variants. Topocentric rotation-wise will always be bound to the vector from planet's center to the origin, plus either geographic north ( planet axis direction) or direction of the target object relative to surface (this reduces some 3D problems to 2D, e.g. ascent trajectory). It happens in two major variants that differ in location of the origin. In one it will be the 'target craft' - for example the ISS, when maneuvering Soyuz around. The other variant binds the origin to the planet's 'reference altitude' (e.g. sea level) at the point below the craft's nadir. This will provide the altitude and vertical speed of the craft relative to Earth - important for spaceplanes, reentry capsules etc.

In Astronomy, the Horizontal coordinate system is topocentric.

Geocentric - other than which 'geo' you choose sometimes happens as Carthesian (x,y,z) and sometimes as radial (longitude, latitude, altitude). While the first is better computationally, the second will give a better orientation of where your objects are relative to the surface... or help tracking the origin of your topocentric system.

And for perifocal, all the rest - in astronomy, equatorial and ecliptic have origin at Earth center, and differ in its orientation relative to direction of Vernal Equinox. Galactic and Supergalactic origin at the Sun and have different reference directions too. Then there's representation - Carthesian (usually alongside with velocities, for state vector), Spherical, Keplerian elements, and many their variants and derivatives like TLE, Mean, Osculating etc. Never mind rotational orientation of bodies is often defined in terms of quaternions.

Where, which of these? Depends on application. Keplerian and family are good for determining what sort of orbit at a glance, and finding other general parameters (like orbital period, or orbital velocity at arbitrary point) easily. Carthesian (often coupled with quaternions) will again be good for numerical computation. Spherical are the standard for astronomy, where distance ('altitude') is far harder to determine than the other two angles. Outside of astronomy, spherical perifocal systems aren't that good for immediate use, but may help converting between the prior two groups. And if you have awesome precision at the disposal, you just put the origin in the Sun (or the solar system barycenter if you want to be nitpicky) and worry no more. If you're working with standard 64-bit Doubles, you may need to get creative in picking an origin that gives you sufficiently low error over the whole area of interest.

• Wow thank a lot for this post, the different way of explaining these frames really helps. Rereading the same paragraph in a textbook can only do so much for you. Hearing someone smart casually talk about this stuff is very helpful in contrast to the dull, almost overly formal, tone used in academia. I'm sure I'll return and reread this at least 10 times whenever I get to a part about frames hah. Oct 3, 2018 at 23:53