# The Lagrange Coefficients¶

The Lagrange coefficients are a set of 4 scalar functions that allow us to determine the orbit given only the initial position and velocity. We do not need to know the shape of the orbit beforehand, because we will see that the Lagrange coefficients do not depend on the eccentricity.

The position and velocity vectors at any time are linear combinations of the Lagrange coefficients and the initial conditions. This useful property allows us to introduce the time variable into our equations.

## Position, Velocity, and Angular Momentum¶

We start by defining the initial conditions, subscripted with a \(0\):

Then the angular momentum is found by taking the cross product:

From the definition of the \(\uvec{w}\) unit vector, we can see that the magnitude of the angular momentum must be:

Now we want to write the unit vectors \(\uvec{p}\) and \(\uvec{q}\) in terms of the initial conditions. Equation (232) contains two equations, and \(\uvec{p}\) and \(\uvec{q}\) are the two unknowns. We will use the magnitude of the angular momentum to help simplify. We end up with:

Putting these two unit vectors back into the equations for the general position and velocity, and simplifying, we find:

By inspecting these two equations, we can see that they are composed of a linear combination of \(\vector{r}_0\) and \(\vector{v}_0\). In addition, the coefficients in front of the initial position and velocity are related. These are called the **Lagrange coefficients**, and given the symbols \(f\), \(g\), \(\dot{f}\), and \(\dot{g}\):

Note that the time derivative coefficients, \(\dot{f}\) and \(\dot{g}\), only take the time derivative of the time-varying components, that is, \(x\) and \(y\). The initial conditions are constant, by definition.

From the conservation of angular momentum, we know that

since the angular momentum is constant. This imposes a condition on the relationship between the Lagrange coefficients:

Thus, if any three of the Lagrange coefficients are known, the fourth can be determined from this constraint.

## Coefficients in Terms of the True Anomaly¶

We can use a *lot* of algebra and trig to define the Lagrange coefficients in terms of the change of true anomaly:

These equations allow us to determine the state vector, given the initial conditions \(\vector{r}_0\) and \(\vector{v}_0\), and the desired change in true anomaly. Notice that we don’t require the type of orbit, since the eccentricity does not appear in any of these equations.

One further equation that we need is the orbit equation in terms of the change of true anomaly:

The disadvantage of these equations is that we cannot solve for periapsis or apoapsis distances, without first calculating the eccentricity and true anomaly of the initial point. Fortunately, these can be calculated as follows. First, obtain the specific angular momentum from:

Then, project the initial velocity into the radial direction by taking the dot product of the initial velocity with a unit vector pointing in the direction of \(\vector{r}_0\):

Then, we can solve for the eccentricity and initial true anomaly from the orbit equation and its derivative: