function sphere_triangle_sides_to_area_test ( )

%*****************************************************************************80
%
%% sphere_triangle_sides_to_area_test() tests sphere_triangle_sides_to_area().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 November 2025
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sphere_triangle_sides_to_area_test():\n' );
  fprintf ( 1, '  sphere_triangle_sides_to_area() takes the sides of a\n' );
  fprintf ( 1, '  spherical triangle and determines the area.\n' );

  r = 1.0;
  ad = 90;
  bd = 90;
  cd = 90;
%
%  Convert to radians.
%
  ar = degrees_to_radians ( ad );
  br = degrees_to_radians ( bd );
  cr = degrees_to_radians ( cd );
%
%  Multiply by R for physical length of sides.
%
  as = r * ar;
  bs = r * br;
  cs = r * cr;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sphere has radius %g inches\n', r );
  fprintf ( 1, '  side A: %g degrees  %g radians  %g inches\n', ad, ar, as );
  fprintf ( 1, '  side B: %g degrees  %g radians  %g inches\n', bd, br, bs );
  fprintf ( 1, '  side C: %g degrees  %g radians  %g inches\n', cd, cr, cs );
%
%  Get the area.
%
  area = sphere_triangle_sides_to_area ( r, as, bs, cs );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed area           = %g\n', area );
%
%  Alternate calculation:
%
  [ ar, br, cr ] = sphere_triangle_sides_to_angles ( r, as, bs, cs );
  area = sphere_triangle_angles_to_area ( r, ar, br, cr );

  fprintf ( 1, '  Alternate computed area = %g\n', area );
  fprintf ( 1, '  Exact area              = %g\n', pi / 2.0 );
%
%  Second computation.
%
  r = 10.0;
%
%  Measure each side in degrees.
%
  ad = 121.0 + ( 15.4 / 60.0 );
  bd = 104.0 + ( 54.7 / 60.0 );
  cd =  65.0 + ( 42.5 / 60.0 );
%
%  Convert to radians.
%
  ar = degrees_to_radians ( ad );
  br = degrees_to_radians ( bd );
  cr = degrees_to_radians ( cd );
%
%  Multiply by R for physical length of sides.
%
  as = r * ar;
  bs = r * br;
  cs = r * cr;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sphere has radius %g inches\n', r );
  fprintf ( 1, '  side A: %g degrees  %g radians  %g inches\n', ad, ar, as );
  fprintf ( 1, '  side B: %g degrees  %g radians  %g inches\n', bd, br, bs );
  fprintf ( 1, '  side C: %g degrees  %g radians  %g inches\n', cd, cr, cs );
%
%  Get the area.
%
  area = sphere_triangle_sides_to_area ( r, as, bs, cs );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed area           = %g\n', area );
%
%  Alternate calculation:
%
  [ ar, br, cr ] = sphere_triangle_sides_to_angles ( r, as, bs, cs );
  area = sphere_triangle_angles_to_area ( r, ar, br, cr );

  fprintf ( 1, '  Alternate computed area = %g\n', area );

  return
end
