function [ x, w ] = rule09 ( n )

%*****************************************************************************80
%
%% RULE09 returns the rule of degree 9.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL 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.
%
%  Parameters:
%
%    Input, integer N, the number of nodes.
%
%    Output, real X(3,N), the coordinates of the nodes.
%
%    Output, real W(N), the weights.
%
  xs = [ ...
    0.2108052017103265,0.1283729355850052E-02, ...
    -.2918734175018473E-01,-.4357949297689266, ...
    -.1799341637870203,0.6942222186204158E-01, ...
    -.1005642991135230,0.1904855696753355, ...
    0.3231238851996552,0.6819987943340138E-01, ...
    0.9708131623556143E-01,0.4246239788055203, ...
    -.3569664256203109,-.2145752061141752, ...
    -.4818674305781609E-02,-.4314954104621454, ...
    -.1312453567417025,-.4083558222913988, ...
    -.1245612605849638,0.1136348780330888, ...
    0.3351668846328467,0.2159589333207287, ...
    -.1228639493897767,0.1380276243456064, ...
    0.3905319783823730,-.4580867844324543, ...
    0.2310228564389770,0.3554068884610396, ...
    -.6505241861040961E-01,-.1786506541288197, ...
    0.1265104521534247E-01,-.4573827823867556, ...
    -.5542731199877091E-01,-.6387630000068671E-01, ...
    -.3413749732146179,0.5966077890976830, ...
    0.6917314710518101,0.1078283022003015E-01, ...
    0.1833983579629060,-.1566832100689738, ...
    -.7215475195156269,0.5634418100399829, ...
    -.6038175317729408,0.4424617155479634, ...
    0.5376954508544742,0.5801674951413821, ...
    0.1418634443888370,0.3802052805108170E-01, ...
    -.6766546338276799,-.1483779428740810, ...
    0.7588538984987838,-.4009332704109223, ...
    0.4294022281773516,-.4911820218387012, ...
    -.8230436696819400,0.8307385272442451, ...
    0.2847756354434797E-02 ];
  ys = [ ...
    -.8955776048075967E-01,0.6121197754911472E-03, ...
    0.2122758579659528,-.2839355480318341, ...
    -.9582556152029258E-01,-.1394666680707507, ...
    0.4836397528261835,0.3248843951738821, ...
    -.3091097002134723,-.1799541017656358, ...
    0.1346690341273634,-.1974037451364399, ...
    0.5240665094885540E-01,0.2761387382865308, ...
    0.4840041246351735,-.3972752286396523, ...
    0.7569076187744307E-01,-.1239859742013766, ...
    -.2344790300437711,-.3305476987034425E-01, ...
    0.1770622072827525E-01,0.2385246764606510, ...
    0.5313763678851683E-01,0.7344859267512056E-02, ...
    -.2434286634053894,-.2589556174266634, ...
    -.2578369917972710,0.1458366018963618, ...
    -.3194064610603558,-.8361295659204318E-01, ...
    0.2789606323941811,-.3620544381079852, ...
    0.4583494650640864,-.4110512725485398, ...
    0.1453586652323175,-.2817335623108552, ...
    -.4244951895917183,0.7740686042096789, ...
    0.5096501737807261,0.5871627777302516, ...
    -.4069288134308984,-.8745287448038948E-01, ...
    -.1605011166676197,-.4658949840050826, ...
    -.4822919051612324,-.2630487459758545E-01, ...
    0.7093134008050596,-.4981319573109797, ...
    -.1608102554139131,0.7476578114817578, ...
    -.2863864956290275,0.3184909341350718, ...
    0.3342451266830045,-.5259906817121476, ...
    -.4752298758892802,-.4894484556416516, ...
    0.9800293546928647 ];
  zs = [ ...
    0.7735882074261043,0.1020940836140086D+01, ...
    0.7799358723388078,0.3644377643783332, ...
    0.7572044348058194,0.7055487604983020, ...
    -.4071603611745789,0.2784337835342537, ...
    0.3220003691351323,-.3955135683176328, ...
    0.6632209417507691,0.3671897521183273, ...
    -.3747481356463467,0.2325932263186099, ...
    0.3487840306818015,-.4035704541972099, ...
    0.5374900196303547,0.2654318104765763, ...
    0.3698883029355781,0.4369873036895401, ...
    0.1860393220233105,-.3479911186004724, ...
    -.2731450419753432,-.8193864872695196E-01, ...
    -.2812924318728223,-.2546313790752990, ...
    0.8678030145840356E-01,-.1428438498378993, ...
    -.2156622116049685,0.9674903232992661E-01, ...
    0.1583036737187768,-.2371578880066309E-01, ...
    -.2083640565350588,-.1327703130967625E-01, ...
    -.8664488303113425E-01,-.7748272430107629E-01, ...
    -.9669501947122619E-02,-.6316745396431407E-01, ...
    -.1041997605600258,-.7558004547861685E-01, ...
    -.7999199041063003E-01,-.3751069250486347, ...
    -.1299227031705554,-.1892728310331580, ...
    -.3910612496171095,-.1907765273821742, ...
    -.3477134529420335,-.3474543531762018, ...
    -.3606479588180986,-.3440499686491684, ...
    -.3474563411684222,-.3276892436683218, ...
    -.3542380917718721,-.3040019129455090, ...
    -.3440705957046394,-.3298160634602457, ...
    -.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
