function T = Euler2DC( phi, theta, psi )
  cpsi   = cos( psi );
  spsi   = sin( psi );
  ctheta = cos( theta );
  stheta = sin( theta );
  cphi   = cos( phi );
  sphi   = sin( phi );
  %
  % Form the direction cosine matrix that recoordinatizes a vector from the 
  % body frame (B) into the local-level-local-vertical (LV) navigation 
  % frame, which is (North, East, Down).  See Fossen, p.10, Eqn 2.11.
  % Here we will assume the LV frame is intertially fixed and thus
  % also a Newtonian (N) frame.
  %
  % N is the inertially fixed, or Newtonian frame.
  %
  % The transformation T_B_N, is 3-2-1 Euler.  The matrix below, T_N_B, is
  % the transpose.
  %
  %
  T_N_B(1,1) =  cpsi.*ctheta; 
  T_N_B(2,1) =  spsi.*ctheta; 
  T_N_B(3,1) = -stheta; 

  T_N_B(1,2) = -spsi.*cphi + cpsi.*stheta.*sphi; 
  T_N_B(2,2) =  cpsi.*cphi + sphi.*stheta.*spsi; 
  T_N_B(3,2) =  ctheta.*sphi; 

  T_N_B(1,3) =  spsi.*sphi + cpsi.*cphi.*stheta; 
  T_N_B(2,3) = -cpsi.*sphi + stheta.*spsi.*cphi;
  T_N_B(3,3) =  ctheta.*cphi; 
  %
  % Output T_B_N:
  T = T_N_B';
end
  
