RE2Hills:

% Compute the Hills-frame state associated with a relative ellipse.

-------------------------------------------------------------------------------
   Usage:
   xH = RE2Hills( x, y, y0, aE, zA, zR, n );
-------------------------------------------------------------------------------

   ------
   Inputs
   ------
   x             (1)   Radial position
   y             (1)   Along-track position
   y0            (1)   Center of along-track motion
   aE            (1)   Semi-major axis of relative ellipse
   zA            (1)   Cross-track offset at forward along-track axis crossing
   zR            (1)   Cross-track offset at high radial axis crossing
   n             (1)   Mean orbit rate [rad/s]

   -------
   Outputs
   -------
   xH            (1)   Hills-frame state on relative ellipse

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