function [ x, w ] = rule18 ( n )

%*****************************************************************************80
%
%% RULE18 returns the rule of degree 18.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    07 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 = [ ...
    -.9824292972819758,-.9803800150830472, ...
    0.9786873970954008,0.9783064717068459, ...
    0.9721036514650782,0.5934299192489508, ...
    0.5976341012197494,-.3692961886011435, ...
    0.7049479055795181,-.7373468008004338, ...
    0.9861989064660380,-.8465158209874328E-01, ...
    0.8850139974482023,-.9313926150284875, ...
    -.7089981957319805,0.8732614092173598, ...
    -.8419399215622921,0.3224279462028189, ...
    0.2244640124522700,-.8347180004932071, ...
    -.8279536304784142,-.6568125381001307, ...
    -.8460042964230963,-.9242174294702851, ...
    -.5414368844899894,0.9265304841706828, ...
    -.8981156173043389,-.4115732120271069, ...
    0.6047453622518654,-.5983900835098156, ...
    0.4320397790648277,0.4499667234152572, ...
    0.9513764564603604,-.6795979700947666, ...
    -.6564652118524049,0.8378047852517292, ...
    -.1113556772390856,-.3608746962710803, ...
    0.9862753904173321,-.2331918978886594, ...
    -.9870492227974196,-.9894160854750882, ...
    -.9836502238795436,0.8002432442611336, ...
    0.6492404239850669,0.8701160725699196, ...
    0.7389321385106327,-.4715855030569622, ...
    0.7436165358202136,0.3534834684769252, ...
    -.3650849452075164,-.2283506208713122, ...
    0.1740274102467612,0.8995839783500573, ...
    0.3405925655026003,0.4295328792252409E-01, ...
    0.1448653016063912,-.1312827821241097, ...
    0.5004638295686703,0.6006609259220026E-01, ...
    0.1552257232885370,-.9395864632354990, ...
    -.4791507758959901,-.8137902397325638 ];
  ys = [ ...
    -.9492304540136947,0.9469609026131530, ...
    0.7622186219256711,-.9196983748762729, ...
    0.9764183470032382,-.9616466720526158, ...
    0.8343589711117383,0.9800036938552533, ...
    0.9870747330066914,-.8333460482416958, ...
    -.3278737740897394,0.8908466843089227, ...
    -.9855803626832146,-.8212845135474046, ...
    0.6822143912173052,0.9031148761319726, ...
    0.9885786707367459,0.5365154393395204E-01, ...
    0.7350437600270140,0.5084609108470370, ...
    -.6132315128115761,0.2290780703350274, ...
    -.9786418155875946,-.3102577845761006, ...
    -.6275098391746888,0.1407483577400233E-01, ...
    0.8295680022967102,0.7753196502785407, ...
    -.6526316599009200,-.9333674622588783, ...
    0.9243432783386737,0.7005646989935736E-01, ...
    -.6925969506257750,-.3641945758998874, ...
    0.9193665018045939,-.4639915525654867, ...
    -.9041936920710849,-.7808865818750257, ...
    0.2974467982752778,-.4343746051515523, ...
    -.5898322990766285,-.1604383366455782E-01, ...
    0.6393477839238390,-.8481629731994191, ...
    -.2054507717193144,-.1017355764563722, ...
    0.7159568279790096,-.1245817088489083, ...
    0.2542532076804419,-.8415199898068800, ...
    -.9897219383699781,0.1556384545656453, ...
    -.9791074324031704,0.5295267411341480, ...
    -.4165391069331053,-.1509802365687459, ...
    0.3347376662738560,0.5759504751299614, ...
    0.5086985983019631,-.6661951769904182, ...
    0.9847264496502689,0.3003342534564235, ...
    0.4492326697835803,-.6261874651130582E-02/
  ws = [ ...
    0.4880182878194577E-02,0.5801719791846293E-02, ...
    0.1363202620128554E-01,0.7756485561516194E-02, ...
    0.4249395346845679E-02,0.2449228653823736E-01, ...
    0.2751148878355652E-01,0.1865262619502059E-01, ...
    0.1160827955745764E-01,0.2909451783554787E-01, ...
    0.1614009453230349E-01,0.5169172255655628E-01, ...
    0.7388591103278081E-02,0.2021700469490708E-01, ...
    0.4636019735255641E-01,0.2315518049910366E-01, ...
    0.7815468109974862E-02,0.3769198715796499E-01, ...
    0.7881010252197586E-01,0.3988856078693273E-01, ...
    0.4079805534552380E-01,0.6645673137795649E-01, ...
    0.1072546708888146E-01,0.3868425989902273E-01, ...
    0.5522501374016728E-01,0.3253997663365805E-01, ...
    0.2752684329481517E-01,0.6117844466269161E-01, ...
    0.7168779734796255E-01,0.2620423047578233E-01, ...
    0.3392741843404458E-01,0.7458228761237336E-01, ...
    0.2478342723311915E-01,0.6447492653722675E-01, ...
    0.3284650513806075E-01,0.5368779603413000E-01, ...
    0.4545538155398856E-01,0.5397016565409892E-01, ...
    0.1519721989624682E-01,0.1031663549936232, ...
    0.1231416020827792E-01,0.1349682430871745E-01, ...
    0.1395336957267540E-01,0.3753801076980155E-01, ...
    0.8258232039188609E-01,0.2489123627268648E-01, ...
    0.4546454333835988E-01,0.9452263223987649E-01, ...
    0.7842163445187621E-01,0.5876926206730445E-01, ...
    0.1249000951778932E-01,0.1088923354481117, ...
    0.1951366247998040E-01,0.4179385297531394E-01, ...
    0.1033273611701436,0.1162365062083885, ...
    0.1023818705273872,0.8804476252208088E-01, ...
    0.8910543971624120E-01,0.8874335328605459E-01, ...
    0.1602722062379702E-01,0.3378674145303614E-01, ...
    0.7595232871119993E-01,0.6022146552676879E-01 ];

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

  return
end