ThrustControlGravityTurn:

--------------------------------------------------------------------------
   Thrust control function during gravity turn. 
   Use with GuidedLaunch3D.

   Computes the unit thrust direction along the current ground-relative
   velocity vector of the vehicle. When the velocity is very close to the
   initial velocity of the vehicle, the thrust direction is instead
   defined to be along the position vector.

   Since version 1.0
--------------------------------------------------------------------------
   Form:
   [on,thrustDir] = ThrustControlGravityTurn( r, v, d, params )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   r             (3,1)   ECI position (km)
   v             (3,1)   ECI velocity (km/s)
   d              (.)    Model data
          .Rp            (1,1)   Planet radius (km)
          .v0            (1,1)   Initial ECI velocity.
   params         (.)    Parameters
          .minAlt        (1,1)   Altitude above which to apply thrust (km)

   -------
   Outputs
   -------
   on            (1,1)   Whether thrust is commanded on or not.
   thrustDir     (3,1)   ECI unit thrust direction 

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

Children:

Math: Linear/Mag
Math: Linear/Unit