function rotation_quat2axis_test ( )

%*****************************************************************************80
%
%% rotation_quat2axis_test() tests rotation_quat2axis().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 July 2018
%
%  Author:
%
%    John Burkardt
%
  q = [ 0.836516; 0.12941; -0.482963; -0.224144 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'rotation_quat2axis_test():\n' );
  fprintf ( 1, '  rotation_quat2axis() computes a rotation axis\n' );
  fprintf ( 1, '  and angle from a rotation quaternion.\n' );
  fprintf ( 1, '  rotation_axis2quat() computes a rotation\n' );
  fprintf ( 1, '  quaternion from a rotation axis and angle.\n' );

  r8vec_print ( 4, q, '  The rotation quaternion:' );

  [ axis, angle ] = rotation_quat2axis ( q );

  r8vec_print ( 3, axis, '  The rotation axis:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The rotation angle is %f\n', angle );

  q = rotation_axis2quat ( axis, angle );

  r8vec_print ( 4, q, '  The recovered rotation quaternion:' );

  return
end
