function [ a, b, c, d, w ] = rule02 ( )

%*****************************************************************************80
%
%% rule02() returns the rule of precision 2.
%
%  Discussion:
%
%    The data is given for the reference tetrahedron
%    with vertices (0,0,0), (1,0,0), (0,1,0), (0,0,1).
%
%    We suppose we are given a tetrahedron T with vertices A, B, C, D.
%    We call a rule with n points, returning barycentric coordinates
%    a, b, c, d, and weights w.  Then the integral I of f(x,y,z) over T is 
%    approximated by Q as follows:
%
%    (x,y,z) = a(1:n) * A + b(1:n) * B + c(1:n) * C + d(1:n * D
%    Q = area(T) * sum ( 1 <= i <= n ) w(i) * f(x(i),y(i),z(i)) 
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 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:
%
%    a(n), b(n), c(n), d(n): the barycentric coordinates of quadrature points.
%
%    w(n): the quadrature weights, which sum to 1.
%
  a = [ ...
      0.13819660112501053195, ...
      0.13819660112501053195, ...
      0.58541019662496851517, ...
      0.13819660112501053195 ];

  b = [ ...
      0.13819660112501053195, ...
      0.58541019662496851517, ...
      0.13819660112501053195, ...
      0.13819660112501053195 ];

  c = [ ...
      0.58541019662496851517, ...
      0.13819660112501053195, ...
      0.13819660112501053195, ...
      0.13819660112501053195 ];

  d = [ ...
      0.13819660112501042093, ...
      0.13819660112501042093, ...
      0.13819660112501042093, ...
      0.58541019662496840414 ];

  w = [ ...
      0.25000000000000000000, ...
      0.25000000000000000000, ...
      0.25000000000000000000, ...
      0.25000000000000000000 ];

  return
end
