function [ w, xyz ] = pyramid_unit_o27 ( )

%*****************************************************************************80
%
%% pyramid_unit_o27() returns a 27 point quadrature rule for the unit pyramid.
%
%  Discussion:
%
%    The integration region is defined as:
%
%    - ( 1 - Z ) <= X <= 1 - Z
%    - ( 1 - Z ) <= Y <= 1 - Z
%              0 <= Z <= 1.
%
%    When Z is zero, the integration region is a square lying in the (X,Y) 
%    plane, centered at (0,0,0) with "radius" 1.  As Z increases to 1, the 
%    radius of the square diminishes, and when Z reaches 1, the square has 
%    contracted to the single point (0,0,1).
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Carlos Felippa,
%    A compendium of FEM integration formulas for symbolic work,
%    Engineering Computation,
%    Volume 21, Number 8, 2004, pages 867-890.
%
%  Output:
%
%    real W(27), the weights.
%
%    real XYZ(3,27), the abscissas.
%
  w(1:27,1) = [ ...
   0.036374157653908938268, ...
   0.05819865224625430123, ...
   0.036374157653908938268, ...
   0.05819865224625430123, ...
   0.09311784359400688197, ...
   0.05819865224625430123, ...
   0.036374157653908938268, ...
   0.05819865224625430123, ...
   0.036374157653908938268, ...
   0.033853303069413431019, ...
   0.054165284911061489631, ...
   0.033853303069413431019, ...
   0.054165284911061489631, ...
   0.08666445585769838341, ...
   0.054165284911061489631, ...
   0.033853303069413431019, ...
   0.054165284911061489631, ...
   0.033853303069413431019, ...
   0.006933033103838124540, ...
   0.011092852966140999264, ...
   0.006933033103838124540, ...
   0.011092852966140999264, ...
   0.017748564745825598822, ...
   0.011092852966140999264, ...
   0.006933033103838124540, ...
   0.011092852966140999264, ...
   0.006933033103838124540 ];

  xyz(1:3,1:27) = [ ...
  -0.7180557413198889387,   -0.7180557413198889387,   0.07299402407314973216; ...
   0.00000000000000000000,  -0.7180557413198889387,   0.07299402407314973216; ...
   0.7180557413198889387,   -0.7180557413198889387,   0.07299402407314973216; ...
  -0.7180557413198889387,    0.00000000000000000000,  0.07299402407314973216; ...
   0.00000000000000000000,   0.00000000000000000000,  0.07299402407314973216; ...
   0.7180557413198889387,    0.00000000000000000000,  0.07299402407314973216; ...
  -0.7180557413198889387,    0.7180557413198889387,   0.07299402407314973216; ...
   0.00000000000000000000,   0.7180557413198889387,   0.07299402407314973216; ...
   0.7180557413198889387,    0.7180557413198889387,   0.07299402407314973216; ...
  -0.50580870785392503961,  -0.50580870785392503961,  0.34700376603835188472; ...
   0.00000000000000000000,  -0.50580870785392503961,  0.34700376603835188472; ...
   0.50580870785392503961,  -0.50580870785392503961,  0.34700376603835188472; ...
  -0.50580870785392503961,   0.00000000000000000000,  0.34700376603835188472; ...
   0.00000000000000000000,   0.00000000000000000000,  0.34700376603835188472; ...
   0.50580870785392503961,   0.00000000000000000000,  0.34700376603835188472; ...
  -0.50580870785392503961,   0.50580870785392503961,  0.34700376603835188472; ...
   0.00000000000000000000,   0.50580870785392503961,  0.34700376603835188472; ...
   0.50580870785392503961,   0.50580870785392503961,  0.34700376603835188472; ...
  -0.22850430565396735360,  -0.22850430565396735360,  0.70500220988849838312; ...
   0.00000000000000000000,  -0.22850430565396735360,  0.70500220988849838312; ...
   0.22850430565396735360,  -0.22850430565396735360,  0.70500220988849838312; ...
  -0.22850430565396735360,   0.00000000000000000000,  0.70500220988849838312; ...
   0.00000000000000000000,   0.00000000000000000000,  0.70500220988849838312; ...
   0.22850430565396735360,   0.00000000000000000000,  0.70500220988849838312; ...
  -0.22850430565396735360,   0.22850430565396735360,  0.70500220988849838312; ...
   0.00000000000000000000,   0.22850430565396735360,  0.70500220988849838312; ...
   0.22850430565396735360,   0.22850430565396735360,  0.70500220988849838312 ]';

  return
end
