function tet_mesh_test002 ( )

%*****************************************************************************80
%
%% tet_mesh_test002() tests tetrahedron_order4_physical_to_reference(), tetrahedron_order4_reference_to_physical().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 December 2006
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  t = [ ...
    5.0, 0.0, 0.0; ...
    8.0, 0.0, 0.0; ...
    5.0, 2.0, 0.0; ...
    6.0, 1.0, 2.0 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'tet_mesh_test002():\n' );
  fprintf ( 1, '  tetrahedron_order4_physical_to_reference()\n' );
  fprintf ( 1, '  maps a physical point to a reference point.\n' );
  fprintf ( 1, '  tetrahedron_order4_reference_to_physical() \n' );
  fprintf ( 1, '  maps a reference point to a physical point.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ...
    '     ( R, S, T )          ==>  ( X, Y, Z )           ==> ( R2, S2, T2 )\n' );
  fprintf ( 1, '\n' );

  ref = tetrahedron_reference_sample ( n );

  phy = tetrahedron_order4_reference_to_physical ( t, n, ref );
  ref2 = tetrahedron_order4_physical_to_reference ( t, n, phy );

  for j = 1 : n

    fprintf ( 1, '  %8f  %8f  %8f    %8f  %8f  %8f    %8f  %8f  %8f\n', ...
      ref(1:3,j), phy(1:3,j), ref2(1:3,j) );

  end

  return
end
