function [ x, w ] = rule18 ( n )

%*****************************************************************************80
%
%% RULE18 returns the rule of degree 18.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    01 July 2014
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This MATLAB version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
%  Parameters:
%
%    Input, integer N, the number of nodes.
%
%    Output, real X(2,N), the coordinates of the nodes.
%
%    Output, real W(N), the weights.
%
  xs = [ ...
   -0.9669786385710223E+00, ...
    0.9737001842077581E+00, ...
    0.9669786385710225E+00, ...
   -0.9737001842077578E+00, ...
   -0.2156318842512505E+00, ...
    0.9910931195695962E+00, ...
    0.2156318842512506E+00, ...
   -0.9910931195695962E+00, ...
   -0.7389660590011030E+00, ...
    0.9797385272966153E+00, ...
    0.7389660590011032E+00, ...
   -0.9797385272966153E+00, ...
    0.7689094060317012E+00, ...
    0.9882749272572955E+00, ...
   -0.7689094060317010E+00, ...
   -0.9882749272572955E+00, ...
   -0.8922402234413791E+00, ...
    0.8925564983087213E+00, ...
    0.8922402234413791E+00, ...
   -0.8925564983087213E+00, ...
    0.2617471442719549E+00, ...
    0.9844702542794935E+00, ...
   -0.2617471442719548E+00, ...
   -0.9844702542794935E+00, ...
   -0.7742833119206508E+00, ...
    0.7411227454690407E+00, ...
    0.7742833119206508E+00, ...
   -0.7411227454690407E+00, ...
   -0.5506736485553229E+00, ...
    0.8796491853095826E+00, ...
    0.5506736485553229E+00, ...
   -0.8796491853095826E+00, ...
   -0.5792562772184127E+00, ...
    0.5652337954199163E+00, ...
    0.5792562772184127E+00, ...
   -0.5652337954199163E+00, ...
   -0.1014796206724937E-01, ...
    0.9024857168797702E+00, ...
    0.1014796206724948E-01, ...
   -0.9024857168797702E+00, ...
    0.5420066475220151E+00, ...
    0.9210890053684702E+00, ...
   -0.5420066475220149E+00, ...
   -0.9210890053684702E+00, ...
    0.2943587054075071E+00, ...
    0.7683262972049428E+00, ...
   -0.2943587054075070E+00, ...
   -0.7683262972049428E+00, ...
   -0.3513695172888806E+00, ...
    0.3692629613410464E+00, ...
    0.3513695172888806E+00, ...
   -0.3692629613410464E+00, ...
   -0.3707443881794703E+00, ...
    0.9667097045148131E+00, ...
    0.3707443881794704E+00, ...
   -0.9667097045148131E+00, ...
   -0.2686897439986438E+00, ...
    0.7370294813846769E+00, ...
    0.2686897439986439E+00, ...
   -0.7370294813846769E+00, ...
   -0.1140106895094741E+00, ...
    0.1969733705383891E+00, ...
    0.1140106895094742E+00, ...
   -0.1969733705383891E+00, ...
    0.3612358695381902E-01, ...
    0.5430113079937613E+00, ...
   -0.3612358695381895E-01, ...
   -0.5430113079937613E+00 ];
  ys = [ ...
   -0.9737001842077582E+00, ...
   -0.9669786385710224E+00, ...
    0.9737001842077579E+00, ...
    0.9669786385710226E+00, ...
   -0.9910931195695962E+00, ...
   -0.2156318842512506E+00, ...
    0.9910931195695962E+00, ...
    0.2156318842512507E+00, ...
   -0.9797385272966153E+00, ...
   -0.7389660590011031E+00, ...
    0.9797385272966153E+00, ...
    0.7389660590011033E+00, ...
   -0.9882749272572955E+00, ...
    0.7689094060317011E+00, ...
    0.9882749272572955E+00, ...
   -0.7689094060317009E+00, ...
   -0.8925564983087213E+00, ...
   -0.8922402234413791E+00, ...
    0.8925564983087213E+00, ...
    0.8922402234413791E+00, ...
   -0.9844702542794935E+00, ...
    0.2617471442719548E+00, ...
    0.9844702542794935E+00, ...
   -0.2617471442719547E+00, ...
   -0.7411227454690407E+00, ...
   -0.7742833119206508E+00, ...
    0.7411227454690407E+00, ...
    0.7742833119206508E+00, ...
   -0.8796491853095826E+00, ...
   -0.5506736485553229E+00, ...
    0.8796491853095826E+00, ...
    0.5506736485553229E+00, ...
   -0.5652337954199163E+00, ...
   -0.5792562772184127E+00, ...
    0.5652337954199163E+00, ...
    0.5792562772184127E+00, ...
   -0.9024857168797702E+00, ...
   -0.1014796206724942E-01, ...
    0.9024857168797702E+00, ...
    0.1014796206724953E-01, ...
   -0.9210890053684702E+00, ...
    0.5420066475220150E+00, ...
    0.9210890053684702E+00, ...
   -0.5420066475220148E+00, ...
   -0.7683262972049428E+00, ...
    0.2943587054075071E+00, ...
    0.7683262972049428E+00, ...
   -0.2943587054075070E+00, ...
   -0.3692629613410464E+00, ...
   -0.3513695172888806E+00, ...
    0.3692629613410464E+00, ...
    0.3513695172888806E+00, ...
   -0.9667097045148131E+00, ...
   -0.3707443881794704E+00, ...
    0.9667097045148131E+00, ...
    0.3707443881794705E+00, ...
   -0.7370294813846769E+00, ...
   -0.2686897439986438E+00, ...
    0.7370294813846769E+00, ...
    0.2686897439986439E+00, ...
   -0.1969733705383891E+00, ...
   -0.1140106895094741E+00, ...
    0.1969733705383891E+00, ...
    0.1140106895094742E+00, ...
   -0.5430113079937613E+00, ...
    0.3612358695381898E-01, ...
    0.5430113079937613E+00, ...
   -0.3612358695381891E-01 ];
  ws = [ ...
    0.4697922862445027E-02, ...
    0.4697922862445027E-02, ...
    0.4697922862445027E-02, ...
    0.4697922862445027E-02, ...
    0.7136263254607511E-02, ...
    0.7136263254607511E-02, ...
    0.7136263254607511E-02, ...
    0.7136263254607511E-02, ...
    0.1293239065568239E-01, ...
    0.1293239065568239E-01, ...
    0.1293239065568239E-01, ...
    0.1293239065568239E-01, ...
    0.9398347568166604E-02, ...
    0.9398347568166604E-02, ...
    0.9398347568166604E-02, ...
    0.9398347568166604E-02, ...
    0.1884626577476044E-01, ...
    0.1884626577476044E-01, ...
    0.1884626577476044E-01, ...
    0.1884626577476044E-01, ...
    0.1572887987347023E-01, ...
    0.1572887987347023E-01, ...
    0.1572887987347023E-01, ...
    0.1572887987347023E-01, ...
    0.4107161379502558E-01, ...
    0.4107161379502558E-01, ...
    0.4107161379502558E-01, ...
    0.4107161379502558E-01, ...
    0.4035221395931435E-01, ...
    0.4035221395931435E-01, ...
    0.4035221395931435E-01, ...
    0.4035221395931435E-01, ...
    0.6647952625116643E-01, ...
    0.6647952625116643E-01, ...
    0.6647952625116643E-01, ...
    0.6647952625116643E-01, ...
    0.4719480581715914E-01, ...
    0.4719480581715914E-01, ...
    0.4719480581715914E-01, ...
    0.4719480581715914E-01, ...
    0.3594938959356454E-01, ...
    0.3594938959356454E-01, ...
    0.3594938959356454E-01, ...
    0.3594938959356454E-01, ...
    0.6892712069447091E-01, ...
    0.6892712069447091E-01, ...
    0.6892712069447091E-01, ...
    0.6892712069447091E-01, ...
    0.8060688072749707E-01, ...
    0.8060688072749707E-01, ...
    0.8060688072749707E-01, ...
    0.8060688072749707E-01, ...
    0.1530603725863855E-01, ...
    0.1530603725863855E-01, ...
    0.1530603725863855E-01, ...
    0.1530603725863855E-01, ...
    0.7313001882369689E-01, ...
    0.7313001882369689E-01, ...
    0.7313001882369689E-01, ...
    0.7313001882369689E-01, ...
    0.7447739831288605E-01, ...
    0.7447739831288605E-01, ...
    0.7447739831288605E-01, ...
    0.7447739831288605E-01, ...
    0.9487170596399580E-01, ...
    0.9487170596399580E-01, ...
    0.9487170596399580E-01, ...
    0.9487170596399580E-01 ];

  x(1,1:n) = xs(1:n);
  x(2,1:n) = ys(1:n);
  w(1:n) = ws(1:n);

  return
end