# Astrodynamics/Coordinate Systems
## What are Coordinate Systems and Reference Frames

Before orbits can be discussed, it is necessary to define the coordinate systems that will be used to describe them. Multiple systems are used in the study of space, and by extension astrodynamics.
A coordinate system defines a method to locate different objects in some space and allows us to measure distances and angles. The most common coordinate system consist of a origin point (0,0,0) and mutually perpendicular axes known as Cartesian coordinates defined by the right hand rule. Think of 2D graphs or 3D space. Each axis is assigned a unit length in the case of Cartesian coordinate it's 1 however this is not a requirement for more exotic systems. Most commonly we will work in Cartesian coordinates: $\mathbb {R} ^{2}$ space or $\mathbb {R} ^{4}$ phase space (position, and velocity/momenta) for the planer case and $\mathbb {R} ^{3}$ space or $\mathbb {R} ^{6}$ for the phase space in the three-dimensional case.
Reference frames are specific view points of a system. Take for example two observers in a field looking at each other and one person running in between them. In the reference frame of one observer the person ran towards the "right" direction whereas the other observer saw the person running "left" in their reference frame. However, both frames relative to the observer correctly describe the motion of the person running. This mismatch can be confusing, misleading, or make the calculations harder. For these reasons it is convenient to define frames that show the definition of an axis and origin and relations to other frames. Thus ensuring consistency, better frames to find solutions, and clarity. However, there is another hidden reason and that's regarding laws of physics which work in inertial frames. A inertial frame is one that is not accelerating which might seem misleading as everything in the universe is moving if not accelerating. Hence, we have defined conventions on what classifies as a reference frame which will be further explained below.
Before moving further it convenient to describe a methodology to change between reference frames. The Direction Cosine Matrix (DCM) is a special matrix that that expresses the position of an object from one reference frame to another. Specifically it if vector $\mathbf {v_{A}}$ shows the position of an object in frame A and vector $\mathbf {v_{B}}$ shows the position of the same object in frame B, where both frames are inertial to each other, then the DCM from frame B to A, $[AB]$, does the following mapping $\mathbf {v_{A}} =[AB]\mathbf {v_{B}}$. Notice, however that this is not a rotation matrix that roates a vector or an axis but rather express the vector/axis in a new frame.

## Coordinate Systems

Every coordinate system consists of three mutually perpendicular axes that describe the three-dimensional coordinates of all points in space. Each particular system is defined by three geometric objects: an origin, a reference direction and a fundamental plane. The origin defines the center from which the axes originate, three options for origins will be discussed in detail here: topocentric, geocentric and heliocentric. The reference direction defines the x-axis. The fundamental plane contains the x-axis and defines the z-axis as the direction normal to the plane. The y-axis completes the right-hand system defined by the other two vectors:
    $\mathbf {\hat {y}} =\mathbf {\hat {z}} \times \mathbf {\hat {x}}$
Positions in these systems may be expressed either as spherical or rectangular coordinates. Generally, spherical coordinates are used in astronomy and other ground-based observations where objects are sufficiently far away to not have discernible parallax.
| Coordinate System | Inertial? | Origin | Fundamental Plane | Reference Direction | Horizontal Angle | Vertical Angle |
| Topocentric Horizon | No | Topocentric | Local Horizon | North/South point | Azimuth | Elevation |
| Earth-centered, Earth-Fixed (ECEF) | No | Geocentric | Equator | Prime Meridian | Geodetic Longitude/ hour angle | Geodetic Latitude/ declination |
| Earth-centered inertial (ECI) | Yes | Geocentric | Equatorial plane | Vernal Equinox | Right Ascension (α) | Declination (δ) |
| Ecliptic | Yes | Geocentric | Ecliptic | Vernal Equinox | Ecliptic longitude(λ) | Ecliptic Latitude (β) |
| Ecliptic | Yes | Heliocentric | Ecliptic | Vernal Equinox | Ecliptic longitude(l) | Ecliptic Latitude (b) |
| Perifocal | Yes | Central body | orbital plane | Periapsis (eccentricity vector) | True anomaly | - |
One can define coordinate systems centered on planets and other large bodies, but these are analogous to geocentric coordinate systems and will not be discussed in great detail. Additional astronomical coordinate systems have been defined, such as galactic and supergalactic, but these are currently of little practical use in astrodynamics.

## Topocentric-Horizon

The topocentric-horizon system, also known as the "SEZ" system is a system of coordinates for use by observers on the surface of the earth. The surface of the observer forms the fundamental plane, that is tangent to the surface of the earth. The positive horizontal vector S is due south , the positive horizontal vector E is east, and the vector Z normal to the surface of the earth (up) is the third axis. Notice that the unit vectors change with time, which means that the topocentric-horizon system is a non-inertial system.
We can introduce a new vector, the vector r$_e$, which is the position vector from the center of the earth to a point on the surface of the earth. It is important to note that the length of this vector is not a constant, because the Earth is not a perfect sphere. The Z vector, which is normal to the surface of the earth does not necessarily pass through the center of the earth, and so it cannot be used to define the r$_e$ vector.

## Geocentric-Equatorial

The geocentric-equatorial coordinate system uses the center of the earth as the origin, and uses the circle of the Earth's equator as the fundamental plane with the positive vertical axis is the north pole of the earth. Two different coordinate frames are generally employed: the Earth-centered, Earth fixed (ECEF) frame, which is non-inertial; and the Earth-centered Inertial (ECI) frame, which is inertial.

### Earth-centered inertial (ECI)

The ECI system is fixed in space, and does not rotate with the earth. The unit vectors that we will be using with the geocentric-equatorial system are I (for the vernal direction), J for the second direction in the equatorial plane), and K (for the direction of the north pole).

## Ecliptic

The heliocentric-ecliptic coordinate system uses the center of the sun as the origin, and is supremely useful for discussing orbits where the sun is the prime focus. The Earth's orbit forms the fundamental plane, and the vertical axis is the normal vector to that fundamental plane.

## Perifocal

The perifocal coordinate system is used to describe a satellite's position within its orbit. In a completely unperturbed orbit, the motion of the satellite is completely confined to one plane of motion, the perifocal system reduces orbital motion from three dimensions to two dimensions, greatly simplifying computations. This is most useful in the process of orbit propagation. Coordinates for the perifocal system are generally expressed as PQW. The fundamental plane is the orbital plane. The P vector points from the prime focus to the periapsis point. The Q vector is in the fundamental plane, rotated 90° from the P vector, in the direction of the orbital motion. The W vector is normal to the orbital plane, and points in the direction of the angular momentum, h. Position and velocity vectors exist entirely within the orbital plane and thus can be described exclusively in terms of P and Q.

## Noninertial Derivatives

A problem arises when we have two coordinate systems, the first is a fixed system (a, b, c) and the second is rotating with respect to the first and is (d, e, f). We know that (d, e, f) is rotating in (a, b, c) with an angular velocity vector ω. That is, we can say:
    $\mathbf {D} '=\mathbf {\omega } \times \mathbf {D}$
    $\mathbf {E} '=\mathbf {\omega } \times \mathbf {E}$
    $\mathbf {F} '=\mathbf {\omega } \times \mathbf {F}$
We have a vector X that is defined in both systems:
    $\mathbf {X} =X_{a}\mathbf {A} +X_{b}\mathbf {B} +X_{c}\mathbf {C} =X_{d}\mathbf {D} +X_{e}\mathbf {E} +X_{f}\mathbf {F}$
The time derivative of A can be defined as:
    ${\frac {d}{dt}}\mathbf {A} |_{(a,b,c)}={\frac {d}{dt}}\mathbf {A} |_{(d,e,f)}+\mathbf {\omega } \times \mathbf {A}$