ComputeRE:

% Compute a safe 2x1 relative in-plane ellipse. 
 The ellipse is chosen such that:
 * it can be reached with a single, immediate delta-v
 * it does not intersect with a 2x1 elliptical avoidance region 
 * its semi-major axis is greater than the defined minimum value
 * it requires the lowest delta-v to meet the above constraints

 NOTE: This algorithm assumes that the current relative position is 
 ALREADY OUTISDE THE AVOIDANCE REGION.

--------------------------------------------------------------------------
   Usage:
   [x0,aE] = ComputeRE( x, z, vz, n, aEMin, dMin, verbose );
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x             (1)   Along-track position [km]
   z             (1)   Radial position      [km]
   vz            (1)   Radial velocity      [km/s]
   n             (1)   Mean orbit rate      [rad/s]
   aEMin         (1)   Minimum semi-major axis for relative ellipse [km]
   dMin          (1)   Minimum along-track separation distance      [km/s]
   verbose       (1)   Flag. Print results during execution?

   -------
   Outputs
   -------
   x0            (1)   Center of along-track motion           [km]
   aE            (1)   Semi-major axis of relative ellipse    [km]

--------------------------------------------------------------------------