function [ x, y, w ] = square_symq ( degree, n )

%*****************************************************************************80
%
%% square_symq() returns a symmetric quadrature rule for the square.
%
%  Discussion:
%
%    This procedure returns a quadrature rule for smooth functions
%    on the unit square [-1,1]^2.
%
%    All quadratures are accurate to 15 digits
%    All weights are positive and inside the square
%
%    The nodes are symmetrically arranged.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 June 2023
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
%  Input:
%
%    integer DEGREE, the degree of the quadrature rule.
%    0 <= DEGREE <= 20.
%
%    integer N, the number of nodes.
%    This can be determined by a call to rule_order(degree).
%
%  Output:
%
%    real x(n), y(n): the coordinates of the nodes.
%
%    real w(n): the weights.
%
  if ( degree == 0 )
    [ x, y, w ] = rule00 ( n );
  elseif ( degree == 1 )
    [ x, y, w ] = rule01 ( n );
  elseif ( degree == 2 )
    [ x, y, w ] = rule02 ( n );
  elseif ( degree == 3 )
    [ x, y, w ] = rule03 ( n );
  elseif ( degree == 4 )
    [ x, y, w ] = rule04 ( n );
  elseif ( degree == 5 )
    [ x, y, w ] = rule05 ( n );
  elseif ( degree == 6 )
    [ x, y, w ] = rule06 ( n );
  elseif ( degree == 7 )
    [ x, y, w ] = rule07 ( n );
  elseif ( degree == 8 )
    [ x, y, w ] = rule08 ( n );
  elseif ( degree == 9 )
    [ x, y, w ] = rule09 ( n );
  elseif ( degree == 10 )
    [ x, y, w ] = rule10 ( n );
  elseif ( degree == 11 )
    [ x, y, w ] = rule11 ( n );
  elseif ( degree == 12 )
    [ x, y, w ] = rule12 ( n );
  elseif ( degree == 13 )
    [ x, y, w ] = rule13 ( n );
  elseif ( degree == 14 )
    [ x, y, w ] = rule14 ( n );
  elseif ( degree == 15 )
    [ x, y, w ] = rule15 ( n );
  elseif ( degree == 16 )
    [ x, y, w ] = rule16 ( n );
  elseif ( degree == 17 )
    [ x, y, w ] = rule17 ( n );
  elseif ( degree == 18 )
    [ x, y, w ] = rule18 ( n );
  elseif ( degree == 19 )
    [ x, y, w ] = rule19 ( n );
  elseif ( degree == 20 )
    [ x, y, w ] = rule20 ( n );
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 'square_symq(): Fatal error!\n' );
    fprintf ( 1, '  Illegal value of DEGREE.\n' );
    error ( 'square_symq(): Fatal error!' );
  end

  return
end
