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

%*****************************************************************************80
%
%% rule04() returns the prism rule of precision 4.
%
%  Discussion:
%
%    We suppose we are given a triangular prism P with vertices
%    (1,0,0), (0,1,0), (0,0,0),
%    (1,0,1), (0,1,1), (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:
%
%    02 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Jan Jaskowiec, Natarajan Sukumar,
%    High order symmetric cubature rules for tetrahedra and pyramids,
%    International Journal of Numerical Methods in Engineering,
%    Volume 122, Number 1, pages 148-171, 24 August 2020.
%
%  Output:
%
%    real x(n), y(n), z(n): the coordinates of quadrature points.
%
%    real w(n): the quadrature weights, which sum to 1.
%
  x = [ ...
          0.3333333333333333, ...
          0.3333333333333333, ...
          0.4686558098619952, ...
          0.4686558098619952, ...
          0.0626883802760096, ...
          0.1007404057989106, ...
          0.1007404057989106, ...
          0.7985191884021787, ...
          0.1007404057989106, ...
          0.1007404057989106, ...
          0.7985191884021787 ];

  y = [ ...
          0.3333333333333333, ...
          0.3333333333333333, ...
          0.4686558098619952, ...
          0.0626883802760096, ...
          0.4686558098619952, ...
          0.1007404057989106, ...
          0.7985191884021787, ...
          0.1007404057989106, ...
          0.1007404057989106, ...
          0.7985191884021787, ...
          0.1007404057989106 ];

  z = [ ...
          0.0665690129954826, ...
          0.9334309870045174, ...
          0.5000000000000000, ...
          0.5000000000000000, ...
          0.5000000000000000, ...
          0.8378199118411298, ...
          0.8378199118411298, ...
          0.8378199118411298, ...
          0.1621800881588701, ...
          0.1621800881588701, ...
          0.1621800881588701 ];

  w = [ ...
          0.1079119748155355, ...
          0.1079119748155355, ...
          0.1364146126054776, ...
          0.1364146126054776, ...
          0.1364146126054776, ...
          0.0624887020920827, ...
          0.0624887020920827, ...
          0.0624887020920827, ...
          0.0624887020920827, ...
          0.0624887020920827, ...
          0.0624887020920827 ];

  return
end
