NearestOffset:

--------------------------------------------------------------------------
  Determine the nearest along-track offset for a trajectory that is safe.

  Given the current along-track offset and the y-extrema for all other members,
  compute the closest offset such that the minimum and maximum required 
  separation distances are respected.

   Since version 7.
--------------------------------------------------------------------------
   Usage:
   y0 = NearestOffset( y0, width, extrema, minSepDistance, maxSepDistance );
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   y0               (1)    Original along-track offset (on y-axis)
   width            (1)    Width of trajectory on y-axis
   extrema          (1,2N) Extrema pairs (min, max) on y-axis for N other 
                             trajectories
   minSepDistance   (1)    Minimum separation distance between trajectories
   maxSepDistance   (1)    Maximum separation distance between trajectories
   -------
   Outputs
   -------
   y0         (1)   Nearest along-track offset that meets separation objectives
   
--------------------------------------------------------------------------