function triangle_right_error_test ( )

%*****************************************************************************80
%
%% triangle_right_error_test tests triangle_right_error.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 February 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_right_error_test\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test triangle_right_error,\n' );
  fprintf ( 1, '  which reports right triangle error a^2+b^2-c^2\n' );

  v = [ 0.0, 0.0;
        3.0, 0.0;
        0.0, 4.0 ];
  triangle_print ( v, '  Triangle #1:' );
  err = triangle_right_error ( v );
  fprintf ( 1, '  Right triangle error is %g\n', err );
  
  v = [ 4.0, 0.0;
        0.0, 0.0;
        0.0, 3.0 ];
  triangle_print ( v, '  Triangle #2:' );
  err = triangle_right_error ( v );
  fprintf ( 1, '  Right triangle error is %g\n', err );

  v = [ 0.1, 0.0;
        3.0, 0.2;
        0.3, 4.0 ];
  triangle_print ( v, '  Triangle #3:' );
  err = triangle_right_error ( v );
  fprintf ( 1, '  Right triangle error is %g\n', err );

  v = rand ( 3, 2 );
  triangle_print ( v, '  Triangle #4:' );
  err = triangle_right_error ( v );
  fprintf ( 1, '  Right triangle error is %g\n', err );
        
  return
end