function [ x, y, z, w ] = rule04 ( )

%*****************************************************************************80
%
%% rule04() returns the pyramid quadrature rule of precision 4.
%
%  Discussion:
%
%    We suppose we are given a pyramid P with vertices
%      (-1,-1,0), (-1,+1,0), (+1,+1,0), (+1,-1,0), (0,0,1).
%    We call a rule with n points, returning coordinates
%    x, y, z, and weights w.  Then the integral I of f(x,y,z) over
%    P is approximated by Q as follows:
%
%    Q = volume(P) * sum ( 1 <= i <= n ) w(i) * f(x(i),y(i),z(i)) 
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Freddie Witherden, Peter Vincent,
%    On the identification of symmetric quadrature rules for finite element methods,
%    Computers and Mathematics with Applications,
%    Volume 69, pages 1232-1241, 2015.
%
%  Output:
%
%    x(n), y(n), z(n): the coordinates of quadrature points.
%
%    w(n): the quadrature weights, which sum to 1.
%
  x = [ ...
          0.0000000000000000, ...
          0.0000000000000000, ...
          0.6505815563982326, ...
          0.0000000000000000, ...
         -0.6505815563982326, ...
          0.0000000000000000, ...
          0.6579669971216900, ...
          0.6579669971216900, ...
         -0.6579669971216900, ...
         -0.6579669971216900 ];

  y = [ ...
          0.0000000000000000, ...
          0.0000000000000000, ...
          0.0000000000000000, ...
          0.6505815563982326, ...
          0.0000000000000000, ...
         -0.6505815563982326, ...
          0.6579669971216900, ...
         -0.6579669971216900, ...
          0.6579669971216900, ...
         -0.6579669971216900 ];

  z = [ ...
          0.6772327888861374, ...
          0.1251369531087465, ...
          0.3223841495782137, ...
          0.3223841495782137, ...
          0.3223841495782137, ...
          0.3223841495782137, ...
          0.0392482838988154, ...
          0.0392482838988154, ...
          0.0392482838988154, ...
          0.0392482838988154 ];

  w = [ ...
          0.1137418831706419, ...
          0.2068834025895523, ...
          0.1063245878893255, ...
          0.1063245878893255, ...
          0.1063245878893255, ...
          0.1063245878893255, ...
          0.0635190906706259, ...
          0.0635190906706259, ...
          0.0635190906706259, ...
          0.0635190906706259 ];

  return
end
