Goals2Hills:

--------------------------------------------------------------------------
   Computes the desired relative position and velocity in Hills frame, given the 
   formation flying geometric "goals" and the reference orbital elements.

   Since version 7.
--------------------------------------------------------------------------
   Form:
   xH = Goals2Hills( el0, goals );
   xH = Goals2Hills( n, theta, goals );
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   el0             (1,6)     Reference orbital elements (Alfriend format) [a,th,i,q1,q2,W]
     -or-
   n                (1)      Mean orbit rate [rad/sec]
   theta            (1)      True latitude   [rad]

   goals            (.)      Geometric goals data structure with following fields:
     - y0          (1,:)        along-track offset                             [km]
     - aE          (1,:)        semi-major axis of relative ellipse            [km]
     - beta        (1,:)        angle on ellipse at perigee                   [rad]
     - zInc        (1,:)        cross-track amplitude due to inclination diff  [km]
     - zLan        (1,:)        cross-track amplitude due to right ascen diff  [km]

   -------
   Outputs
   -------
   xH              (6,:)     Hills frame position and velocity  
                                [km; km; km; km/s; km/s; km/s]
                                [ x;  y;  z;   Vx;   Vy;   Vz]

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

Children:

FormationFlying: Coord/CirclePhase
SC: BasicOrbit/OrbRate