# Astrodynamics/Orbit Basics
## Trajectory Equation

The trajectory equation, which gives us the shape of the orbit is given as:
[Trajectory Equation]
    $r={\frac {\frac {h^{2}}{\mu }}{1+{\frac {B}{\mu }}\cos \nu }}$
Where B is a constant of integration, and ν (Greek letter nu) is the angle between the semi-major axis and the position vector r.

## Conic Sections

Let us digress a little bit from the theory of an orbit, and discuss conic sections. People are typically familiar with conic sections (circle, elipse, parabola, hyperbola) from studying elementary algebra. However, the form in which most people are not familiar with these conic sections is in the standard cartesian coordinate system. If we use a polar coordinate system instead, we can see that the conic sections all have a similar equation format. We can generalize, and say that all conic sections have the following polar equation:
[Conic Section Equation]
    $r={\frac {p}{1+e\cos \theta }}$
Here, r is the radius, and θ is the angle. As θ travels around the circle, the value for r changes and the resulting points create the necessary conic sections. The variable p is known as the parameter, and the variable e is known as the eccentricity. We will discuss these variables, and describe how they relate to the trajectory equation below.

### Parameter

Comparing the trajectory equation and the conic section equation, we can see that:
    $p={\frac {h^{2}}{\mu }}$
the variable p is a measure of the size of the conic section. Larger p means the orbit is larger. We can see that the size of an orbit is directly proportional to how much angular momentum the satellite has. Because of this relationship, we can get the vague sense that the more speed a satellite has, the larger the resulting orbit will be.

### Eccentricity

The value for e, the eccentricity, determines the shape the orbit will take. This table shows the various values for e, and the resulting shape of the conic section:
| e | Shape |
| $e=0$ | Circle |
| $e<1$ | Elipse |
| $e=1$ | Parabola |
| $e>1$ | Hyperbola |
Looking at our conic section equation, and the trajectory equation, we can see that:
    $e={\frac {B}{\mu }}$
We know that B is just a constant of integration that doesn't correspond to any natural quantity. We can calculate e directly without having to calculate B first. We can relate e to the energy and the angular momentum of the satellite by:
    $e={\sqrt {1+{\frac {2{\mathcal {E}}h^{2}}{\mu ^{2}}}}}$
We can also relate e and p together, using the length of the semi-major axis, a:
    $p=a(1-e^{2})$

### Eccentricity Vector

We can also define an eccentricity vector, e, as:
[Eccentricity Vector]
    $\mathbf {e} ={\frac {\mathbf {v} \times \mathbf {h} }{\mu }}-{\frac {\mathbf {r} }{r}}$
This vector has the property that:
    $e=|\mathbf {e} |$
And that e points towards the periapsis point (described below).

## Orbits

We can see that the trajectory equation is in the form of a conic section, and because of this form it's actually possible to have orbits in the shape of any conic section. We will discuss some of them below.

### Elliptical

An elliptical orbit is an orbit with eccentricity e < 1. Elliptical orbits are some of the most common orbits, and nearly all bodies that travel around the sun have elliptical orbits.
We know from the equations for p that the speed of the satellite affects the size of the orbit. We also know from the equation relating p and e that the speed can affect the shape of the orbit. Putting a satellite into a certain orbit then is a matter of giving the satellite the correct speed for that orbit. An elliptical orbit is an orbit that is created by a speed less than the escape speed. The escape speed, which we will talk about below, is the speed at which a satellite breaks free from the gravity of the prime focus and forms a parabolic or elliptical orbit.
There is a particular speed known as the circular speed at which an elliptical orbit becomes a perfect circle. All other speeds, besides the circular speed and below the escape velocity create an elliptical orbit.
The values for these speeds can be calculated by plugging in the appropriate values into the trajectory equation to create the desired conic section, and then solving for the kinetic energy. We will omit the derivations here.
Example: Earth's Orbit
Earths orbit is elliptical, although the two foci are relatively close together giving earth an orbit that is nearly circular. Because space is a vacuum and there is no appreciable drag or friction, the speed of the earth is constant and the orbit of earth is, therefore, constant. Mathematically, the earth will never spiral into the sun.

### Circular

A circular orbit is an orbit with eccentricity e = 0. A circle is a special case of the ellipse. Circular orbits are difficult to obtain, but not impossible. The speed necessary to maintain a circular orbit is known as circular speed. We can define circular speed as:
[Circular Speed]
    $v_{cs}={\sqrt {\frac {\mu }{r}}}$
Where r in this case is the radius of the circular orbit.
Example: Geostationary Satellites
Geostationary satellites are placed in one particular orbit where the period is exactly equal to the rotational speed of the Earth. In this sense, the Geostationary satellite is "stationary" with respect to the surface of the Earth, which proves very useful in communications and meteorological applications.

### Parabolic

A parabolic orbit is an orbit with eccentricity e = 1. The speed necessary to form a parabolic orbit is known as the escape velocity v$_e$. The escape velocity is the minimum speed necessary to escape from the gravitational pull of the primary focus. Notice that when we obtain this minimum escape speed, we break free from the gravity of the prime focus, but our velocity approaches zero:
    $v_{\infty }=0$
We can define the escape velocity as:
[Escape Velocity]
    $v_{er}={\sqrt {\frac {2\mu }{r}}}$
In this case, r is the distance of the satellite from the primary focus, and v$_{er}$ is the escape velocity from the point r. For earth the velocity is equal to 2nd escape velocity which is 11.1799 km/s

### Hyperbolic

A hyperbolic orbit has eccentricity e > 1. Hyperbolic orbits are sometimes also known as escape orbits, because a hyperbolic orbit allows a satellite to "break free" from the gravity of the prime focus, while maintaining some velocity. The amount of speed the satellite has over the escape velocity of the parabolic orbit is known as 'excess hyperbolic speed, v$_h$ and can be found by comparing to the launch velocity (or the velocity at periapsis) v$_l$:
    $v_{l}=v_{e}+v_{h}$
And compared to the parabolic orbit, we have our final velocity as:
    $v_{\infty }=v_{h}$

### Degenerate

People familiar with conic sections may recognize that there are also degenerate conics: points and straight lines. Degenerate conics occur for values of h = 0, which means that e = 1 (a parabola), but that the orbit will not be parabolic.

## Apses

The line between the foci is known as the major axis (in an ellipse and a hyperbola). The points at the intersection of the curve and the major axis are known as the apses. The point nearest the primary focus is called the periapsis, and the point nearest to the secondary focus is called the apoapsis. There are several other words that can be used interchangeably:
| Central Body | Closest Distance | Furthest Distance |
| General | Periapsis/Pericenter | Apoapsis/Apocenter |
| Earth | Perigee | Apogee |
| Sun | Perihelion | Aphelion |
Additional terms exist for other solar system bodies, but these are nore required for the purposes of this text.
Circles do not have points furthest or closest to the center, and so the periapsis and apoapsis are undefined on a circle. The parabola has a periapsis, but the apoapsis is considered to be at infinity.
The distance from the prime focus to periapsis can be calculated as:
[Distance to Periapsis]
    $r_{p}={\frac {p}{1+e}}=a(1-e)$
The distance from the prime focus to the apoapsis can be calculated as:
[Distance to Apoapsis]
    $r_{a}={\frac {p}{1-e}}=a(1+e)$
Notice that these equations arise by setting θ = 0° or θ = 180°, because the periapsis is located at zero degrees, and apoapsis is located at 180 degress.

## Vis-Viva Equation

Note that the velocities at the apses must necessarily be perpendicular to the position vectors, thus:
    $||\mathbf {r} _{p}\times \mathbf {v} _{p}||=r_{p}v_{p}=h$
    $||\mathbf {r} _{a}\times \mathbf {v} _{a}||=r_{a}v_{a}=h$
The following expressions can be derived:
    $v_{p}={\sqrt {{\frac {(1+e)}{(1-e)}}{\frac {\mu }{a}}}}$
    $v_{a}={\sqrt {{\frac {(1-e)}{(1+e)}}{\frac {\mu }{a}}}}$
Recall the expression for specific mechanical energy:
    ${\mathcal {E}}={\frac {v^{2}}{2}}-{\frac {\mu }{r}}$
Plugging in values for r$_p$, v$_p$, r$_a$, and v$_a$:
    ${\mathcal {E}}={\frac {v_{p}^{2}}{2}}-{\frac {\mu }{r_{p}}}={\frac {v_{a}^{2}}{2}}-{\frac {\mu }{r_{a}}}$
Solving this equation in terms of a yields:
[Vis-Viva Equation]
    ${\mathcal {E}}={\frac {v^{2}}{2}}-{\frac {\mu }{r}}=-{\frac {\mu }{2a}}$

## Orbital Period

The period of an orbit can be given as:
[Period of Orbit]
    $T=2\pi {\sqrt {a^{3}/\mu }}$
Notice that the period only makes sense for an elliptical or circular orbit, because parabolas and hyperbolas never make a full revolution. Notice also that this equation proves Kepler's third law. We can see this by rearranging the exponents:
    $T^{2}={\frac {4\pi ^{2}}{\mu }}a^{3}$
Now it's clear that the square of the period is proportional to the cube of the major-axis, which is the mean distance from the sun.
The circular orbital period is similar to the elliptical, but with the circle radius, r:
    $T=2\pi {\sqrt {r^{3}/\mu }}$