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

%*****************************************************************************80
%
%% rule18() returns the rule of precision 18.
%
%  Discussion:
%
%    The data is given for the following triangle:
%
%     (0,1) 
%       |   \ 
%       |    \ 
%       |     \ 
%       |      \ 
%     (0,0)----(1,0)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 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:
%
%    real x(n), y(n), z(n): the barycentric coordinates of quadrature points.
%
%    real w(n): the quadrature weights.
%
  x = [ ...
      0.3333333333333334, ...
      0.3999556280675762, ...
      0.2000887438648475, ...
      0.3999556280675762, ...
      0.4875803015748695, ...
      0.0248393968502609, ...
      0.4875803015748695, ...
      0.4618095064064492, ...
      0.0763809871871015, ...
      0.4618095064064492, ...
      0.2422647025142720, ...
      0.5154705949714561, ...
      0.2422647025142720, ...
      0.0388302560886856, ...
      0.9223394878226288, ...
      0.0388302560886856, ...
      0.0919477421216432, ...
      0.8161045157567136, ...
      0.0919477421216432, ...
      0.0458049158598608, ...
      0.7703723762146752, ...
      0.1838227079254640, ...
      0.7703723762146752, ...
      0.1838227079254640, ...
      0.0458049158598608, ...
      0.2063492574338379, ...
      0.6709539851942345, ...
      0.1226967573719275, ...
      0.6709539851942345, ...
      0.1226967573719275, ...
      0.2063492574338379, ...
      0.0038976110334734, ...
      0.6004189546342569, ...
      0.3956834343322697, ...
      0.6004189546342569, ...
      0.3956834343322697, ...
      0.0038976110334734, ...
      0.0134620167414450, ...
      0.8783421894675217, ...
      0.1081957937910333, ...
      0.8783421894675217, ...
      0.1081957937910333, ...
      0.0134620167414450, ...
      0.0402602834699081, ...
      0.6399880920047146, ...
      0.3197516245253773, ...
      0.6399880920047146, ...
      0.3197516245253773, ...
      0.0402602834699081, ...
      0.0052983351866098, ...
      0.7589294798551984, ...
      0.2357721849581917, ...
      0.7589294798551984, ...
      0.2357721849581917, ...
      0.0052983351866098, ...
      0.0005483600420423, ...
      0.9723607289627957, ...
      0.0270909109951620, ...
      0.9723607289627957, ...
      0.0270909109951620, ...
      0.0005483600420423, ...
      0.1205876951639246, ...
      0.5459187753861946, ...
      0.3334935294498808, ...
      0.5459187753861946, ...
      0.3334935294498808, ...
      0.1205876951639246 ];

  y = [ ...
      0.3333333333333334, ...
      0.2000887438648475, ...
      0.3999556280675762, ...
      0.3999556280675762, ...
      0.0248393968502609, ...
      0.4875803015748695, ...
      0.4875803015748695, ...
      0.0763809871871015, ...
      0.4618095064064492, ...
      0.4618095064064492, ...
      0.5154705949714561, ...
      0.2422647025142720, ...
      0.2422647025142720, ...
      0.9223394878226288, ...
      0.0388302560886856, ...
      0.0388302560886856, ...
      0.8161045157567136, ...
      0.0919477421216432, ...
      0.0919477421216432, ...
      0.7703723762146752, ...
      0.0458049158598608, ...
      0.7703723762146752, ...
      0.1838227079254640, ...
      0.0458049158598608, ...
      0.1838227079254640, ...
      0.6709539851942345, ...
      0.2063492574338379, ...
      0.6709539851942345, ...
      0.1226967573719275, ...
      0.2063492574338379, ...
      0.1226967573719275, ...
      0.6004189546342569, ...
      0.0038976110334734, ...
      0.6004189546342569, ...
      0.3956834343322697, ...
      0.0038976110334734, ...
      0.3956834343322697, ...
      0.8783421894675217, ...
      0.0134620167414450, ...
      0.8783421894675217, ...
      0.1081957937910333, ...
      0.0134620167414450, ...
      0.1081957937910333, ...
      0.6399880920047146, ...
      0.0402602834699081, ...
      0.6399880920047146, ...
      0.3197516245253773, ...
      0.0402602834699081, ...
      0.3197516245253773, ...
      0.7589294798551984, ...
      0.0052983351866098, ...
      0.7589294798551984, ...
      0.2357721849581917, ...
      0.0052983351866098, ...
      0.2357721849581917, ...
      0.9723607289627957, ...
      0.0005483600420423, ...
      0.9723607289627957, ...
      0.0270909109951620, ...
      0.0005483600420423, ...
      0.0270909109951620, ...
      0.5459187753861946, ...
      0.1205876951639246, ...
      0.5459187753861946, ...
      0.3334935294498808, ...
      0.1205876951639246, ...
      0.3334935294498808 ];

  z = [ ...
      0.3333333333333333, ...
      0.3999556280675762, ...
      0.3999556280675762, ...
      0.2000887438648475, ...
      0.4875803015748696, ...
      0.4875803015748695, ...
      0.0248393968502609, ...
      0.4618095064064492, ...
      0.4618095064064492, ...
      0.0763809871871015, ...
      0.2422647025142720, ...
      0.2422647025142720, ...
      0.5154705949714562, ...
      0.0388302560886856, ...
      0.0388302560886856, ...
      0.9223394878226288, ...
      0.0919477421216431, ...
      0.0919477421216432, ...
      0.8161045157567135, ...
      0.1838227079254640, ...
      0.1838227079254640, ...
      0.0458049158598608, ...
      0.0458049158598607, ...
      0.7703723762146752, ...
      0.7703723762146752, ...
      0.1226967573719275, ...
      0.1226967573719275, ...
      0.2063492574338379, ...
      0.2063492574338379, ...
      0.6709539851942345, ...
      0.6709539851942345, ...
      0.3956834343322697, ...
      0.3956834343322698, ...
      0.0038976110334734, ...
      0.0038976110334734, ...
      0.6004189546342569, ...
      0.6004189546342569, ...
      0.1081957937910333, ...
      0.1081957937910333, ...
      0.0134620167414450, ...
      0.0134620167414450, ...
      0.8783421894675217, ...
      0.8783421894675217, ...
      0.3197516245253773, ...
      0.3197516245253773, ...
      0.0402602834699081, ...
      0.0402602834699081, ...
      0.6399880920047146, ...
      0.6399880920047146, ...
      0.2357721849581917, ...
      0.2357721849581918, ...
      0.0052983351866098, ...
      0.0052983351866098, ...
      0.7589294798551984, ...
      0.7589294798551984, ...
      0.0270909109951619, ...
      0.0270909109951620, ...
      0.0005483600420423, ...
      0.0005483600420423, ...
      0.9723607289627956, ...
      0.9723607289627956, ...
      0.3334935294498808, ...
      0.3334935294498808, ...
      0.1205876951639246, ...
      0.1205876951639246, ...
      0.5459187753861946, ...
      0.5459187753861946 ];

  w = [ ...
      0.0181778676507133, ...
      0.0166522350166951, ...
      0.0166522350166951, ...
      0.0166522350166951, ...
      0.0060233238169999, ...
      0.0060233238169999, ...
      0.0060233238169999, ...
      0.0094745857533894, ...
      0.0094745857533894, ...
      0.0094745857533894, ...
      0.0182375447044718, ...
      0.0182375447044718, ...
      0.0182375447044718, ...
      0.0035646630098595, ...
      0.0035646630098595, ...
      0.0035646630098595, ...
      0.0082795799760016, ...
      0.0082795799760016, ...
      0.0082795799760016, ...
      0.0068798081174711, ...
      0.0068798081174711, ...
      0.0068798081174711, ...
      0.0068798081174711, ...
      0.0068798081174711, ...
      0.0068798081174711, ...
      0.0118909554500764, ...
      0.0118909554500764, ...
      0.0118909554500764, ...
      0.0118909554500764, ...
      0.0118909554500764, ...
      0.0118909554500764, ...
      0.0022652672511285, ...
      0.0022652672511285, ...
      0.0022652672511285, ...
      0.0022652672511285, ...
      0.0022652672511285, ...
      0.0022652672511285, ...
      0.0034200550598036, ...
      0.0034200550598036, ...
      0.0034200550598036, ...
      0.0034200550598036, ...
      0.0034200550598036, ...
      0.0034200550598036, ...
      0.0088737445510102, ...
      0.0088737445510102, ...
      0.0088737445510102, ...
      0.0088737445510102, ...
      0.0088737445510102, ...
      0.0088737445510102, ...
      0.0025053304372899, ...
      0.0025053304372899, ...
      0.0025053304372899, ...
      0.0025053304372899, ...
      0.0025053304372899, ...
      0.0025053304372899, ...
      0.0006114740634805, ...
      0.0006114740634805, ...
      0.0006114740634805, ...
      0.0006114740634805, ...
      0.0006114740634805, ...
      0.0006114740634805, ...
      0.0127410876559122, ...
      0.0127410876559122, ...
      0.0127410876559122, ...
      0.0127410876559122, ...
      0.0127410876559122, ...
      0.0127410876559122 ];
%
%  The weights should sum to 1, not 1/2!
%
  w = w * 2.0;

  return
end
