function [ x, w ] = rule09 ( n )

%*****************************************************************************80
%
%% rule09() returns the rule of degree 9.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 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.
%
%  Input:
%
%    integer N, the number of nodes.
%
%  Output:
%
%    real X(3,N), the coordinates of the nodes.
%
%    real W(N), the weights.
%
  xs = [ ...
    0.2108052017103265,0.1283729355850052E-02, ...
    -0.2918734175018473E-01,-0.4357949297689266, ...
    -0.1799341637870203,0.6942222186204158E-01, ...
    -0.1005642991135230,0.1904855696753355, ...
    0.3231238851996552,0.6819987943340138E-01, ...
    0.9708131623556143E-01,0.4246239788055203, ...
    -0.3569664256203109,-0.2145752061141752, ...
    -0.4818674305781609E-02,-0.4314954104621454, ...
    -0.1312453567417025,-0.4083558222913988, ...
    -0.1245612605849638,0.1136348780330888, ...
    0.3351668846328467,0.2159589333207287, ...
    -0.1228639493897767,0.1380276243456064, ...
    0.3905319783823730,-0.4580867844324543, ...
    0.2310228564389770,0.3554068884610396, ...
    -0.6505241861040961E-01,-0.1786506541288197, ...
    0.1265104521534247E-01,-0.4573827823867556, ...
    -0.5542731199877091E-01,-0.6387630000068671E-01, ...
    -0.3413749732146179,0.5966077890976830, ...
    0.6917314710518101,0.1078283022003015E-01, ...
    0.1833983579629060,-0.1566832100689738, ...
    -0.7215475195156269,0.5634418100399829, ...
    -0.6038175317729408,0.4424617155479634, ...
    0.5376954508544742,0.5801674951413821, ...
    0.1418634443888370,0.3802052805108170E-01, ...
    -0.6766546338276799,-0.1483779428740810, ...
    0.7588538984987838,-0.4009332704109223, ...
    0.4294022281773516,-0.4911820218387012, ...
    -0.8230436696819400,0.8307385272442451, ...
    0.2847756354434797E-02 ];
  ys = [ ...
    -0.8955776048075967E-01,0.6121197754911472E-03, ...
    0.2122758579659528,-0.2839355480318341, ...
    -0.9582556152029258E-01,-0.1394666680707507, ...
    0.4836397528261835,0.3248843951738821, ...
    -0.3091097002134723,-0.1799541017656358, ...
    0.1346690341273634,-0.1974037451364399, ...
    0.5240665094885540E-01,0.2761387382865308, ...
    0.4840041246351735,-0.3972752286396523, ...
    0.7569076187744307E-01,-0.1239859742013766, ...
    -0.2344790300437711,-0.3305476987034425E-01, ...
    0.1770622072827525E-01,0.2385246764606510, ...
    0.5313763678851683E-01,0.7344859267512056E-02, ...
    -0.2434286634053894,-0.2589556174266634, ...
    -0.2578369917972710,0.1458366018963618, ...
    -0.3194064610603558,-0.8361295659204318E-01, ...
    0.2789606323941811,-0.3620544381079852, ...
    0.4583494650640864,-0.4110512725485398, ...
    0.1453586652323175,-0.2817335623108552, ...
    -0.4244951895917183,0.7740686042096789, ...
    0.5096501737807261,0.5871627777302516, ...
    -0.4069288134308984,-0.8745287448038948E-01, ...
    -0.1605011166676197,-0.4658949840050826, ...
    -0.4822919051612324,-0.2630487459758545E-01, ...
    0.7093134008050596,-0.4981319573109797, ...
    -0.1608102554139131,0.7476578114817578, ...
    -0.2863864956290275,0.3184909341350718, ...
    0.3342451266830045,-0.5259906817121476, ...
    -0.4752298758892802,-0.4894484556416516, ...
    0.9800293546928647 ];
  zs = [ ...
    0.7735882074261043,0.1020940836140086E+01, ...
    0.7799358723388078,0.3644377643783332, ...
    0.7572044348058194,0.7055487604983020, ...
    -0.4071603611745789,0.2784337835342537, ...
    0.3220003691351323,-0.3955135683176328, ...
    0.6632209417507691,0.3671897521183273, ...
    -0.3747481356463467,0.2325932263186099, ...
    0.3487840306818015,-0.4035704541972099, ...
    0.5374900196303547,0.2654318104765763, ...
    0.3698883029355781,0.4369873036895401, ...
    0.1860393220233105,-0.3479911186004724, ...
    -0.2731450419753432,-0.8193864872695196E-01, ...
    -0.2812924318728223,-0.2546313790752990, ...
    0.8678030145840356E-01,-0.1428438498378993, ...
    -0.2156622116049685,0.9674903232992661E-01, ...
    0.1583036737187768,-0.2371578880066309E-01, ...
    -0.2083640565350588,-0.1327703130967625E-01, ...
    -0.8664488303113425E-01,-0.7748272430107629E-01, ...
    -0.9669501947122619E-02,-0.6316745396431407E-01, ...
    -0.1041997605600258,-0.7558004547861685E-01, ...
    -0.7999199041063003E-01,-0.3751069250486347, ...
    -0.1299227031705554,-0.1892728310331580, ...
    -0.3910612496171095,-0.1907765273821742, ...
    -0.3477134529420335,-0.3474543531762018, ...
    -0.3606479588180986,-0.3440499686491684, ...
    -0.3474563411684222,-0.3276892436683218, ...
    -0.3542380917718721,-0.3040019129455090, ...
    -0.3440705957046394,-0.3298160634602457, ...
    -0.3378012113084769 ];
  ws = [ ...
    0.5680408778529046E-02,0.6887854441113948E-02, ...
    0.6899595536569939E-02,0.6990873936739353E-02, ...
    0.1142122940842178E-01,0.1220808590880294E-01, ...
    0.7651487209643779E-02,0.9540263940869291E-02, ...
    0.9495638963926394E-02,0.1385248437188017E-01, ...
    0.1446333231867884E-01,0.1128763818550772E-01, ...
    0.1290073048331596E-01,0.1468008559737106E-01, ...
    0.1526131467815127E-01,0.7960414659472547E-02, ...
    0.2551792590874883E-01,0.1931170779707098E-01, ...
    0.2561026230172263E-01,0.3169262013385435E-01, ...
    0.2455872440888530E-01,0.2465571070153197E-01, ...
    0.3419839251013865E-01,0.4066027350436995E-01, ...
    0.3092126671144214E-01,0.2731106642703576E-01, ...
    0.3711204543388613E-01,0.2490755526192437E-01, ...
    0.3425568258765496E-01,0.4767735489615401E-01, ...
    0.4389950894493362E-01,0.2234183537671572E-01, ...
    0.3468016547781724E-01,0.1599733331684861E-01, ...
    0.3216001820424372E-01,0.2173130208768448E-01, ...
    0.4172519829863862E-02,0.1261067900439839E-01, ...
    0.2073467359947484E-01,0.1259876220642243E-01, ...
    0.6842300320404830E-02,0.1001228308171065E-01, ...
    0.1328037050111305E-01,0.1493735138014892E-01, ...
    0.6932861063756816E-02,0.6827617690151055E-02, ...
    0.1270616397760185E-01,0.1288875403806118E-01, ...
    0.8899252930026689E-02,0.8881169613715286E-02, ...
    0.5288619835392034E-02,0.1284718318260967E-01, ...
    0.6409598847098365E-02,0.8055508398015583E-02, ...
    0.7788463427997768E-02,0.6545788868966830E-02, ...
    0.5341431206058898E-02 ];

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

  return
end
