function [ x, w ] = rule13 ( n )

%*****************************************************************************80
%
%% RULE13 returns the rule of degree 13.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 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.4870864101401451E+00, -0.2374760548181477E-01, ...
    -0.7693492847298501E+00, 0.9412905403090202E+00, ...
    0.6911155930532483E+00, 0.7898594135857243E+00, ...
    -0.7034504617756053E+00, 0.1116726714264779E+00, ...
    -0.6392758447394441E+00, -0.8512618100723829E+00, ...
    -0.6550935879174717E+00, -0.2012982100456206E-01, ...
    0.2379647994307194E+00, -0.8601912819787483E+00, ...
    -0.9232873932846022E+00, -0.1900861086818608E+00, ...
    0.1929412791278925E-01, 0.7258444409271682E+00, ...
    -0.8143255678954792E+00, 0.2946629110201063E+00, ...
    -0.4322866997565211E+00, 0.9734181389553355E+00, ...
    -0.8655112784848059E+00, -0.9486962755224994E+00, ...
    -0.8639618309045872E+00, 0.4192783763456998E+00, ...
    -0.6493595219283761E-01, -0.3132633581182750E+00, ...
    -0.7107686198927078E+00, 0.1584847796276057E+00, ...
    0.7962238411361664E+00, 0.7050836730161649E+00, ...
    0.8581636882302615E+00, 0.9437903485136390E+00, ...
    -0.9469415138106567E+00, 0.3693463627427371E+00, ...
    -0.4815016166149078E+00, 0.6225323271333136E+00, ...
    -0.1216882752396847E+00, 0.4861399922133740E+00, ...
    -0.6588662398008378E+00, 0.8733371851679250E+00, ...
    -0.5553986064438454E+00, 0.7785003762786959E+00, ...
    -0.9809869293544266E+00, -0.9200430029249042E+00, ...
    0.3304920778295448E+00, 0.3661210439903886E+00, ...
    0.6228621851378309E+00, -0.6948006452003259E+00, ...
    -0.9310681159823312E+00, 0.1927229482124844E+00, ...
    -0.9395909910668155E+00, -0.8918846544837020E+00, ...
    -0.5046559139572119E+00, -0.5501818316586664E+00, ...
    -0.9816538375537931E+00, 0.5810740673825343E-01, ...
    -0.9917476914762476E+00, 0.1619246931269223E+00, ...
    0.4044274445105526E+00, 0.9788832392715772E+00, ...
    0.2896262066021671E+00, -0.9979092625656895E+00, ...
    -0.9953891308905386E+00, -0.4870864101401453E+00, ...
    0.2374760548181472E-01, 0.7693492847298502E+00, ...
    -0.9412905403090200E+00, -0.6911155930532483E+00, ...
    -0.7898594135857244E+00, 0.7034504617756053E+00, ...
    -0.1116726714264779E+00, 0.6392758447394442E+00, ...
    0.8512618100723829E+00, 0.6550935879174717E+00, ...
    0.2012982100456194E-01, -0.2379647994307196E+00, ...
    0.8601912819787482E+00, 0.9232873932846023E+00, ...
    0.1900861086818609E+00, -0.1929412791278927E-01, ...
    -0.7258444409271683E+00, 0.8143255678954792E+00, ...
    -0.2946629110201063E+00, 0.4322866997565212E+00, ...
    -0.9734181389553355E+00, 0.8655112784848059E+00, ...
    0.9486962755224994E+00, 0.8639618309045871E+00, ...
    -0.4192783763456998E+00, 0.6493595219283750E-01, ...
    0.3132633581182749E+00, 0.7107686198927078E+00, ...
    -0.1584847796276057E+00, -0.7962238411361664E+00, ...
    -0.7050836730161649E+00, -0.8581636882302615E+00, ...
    -0.9437903485136390E+00, 0.9469415138106567E+00, ...
    -0.3693463627427371E+00, 0.4815016166149078E+00, ...
    -0.6225323271333137E+00, 0.1216882752396847E+00, ...
    -0.4861399922133739E+00, 0.6588662398008377E+00, ...
    -0.8733371851679250E+00, 0.5553986064438454E+00, ...
    -0.7785003762786958E+00, 0.9809869293544267E+00, ...
    0.9200430029249042E+00, -0.3304920778295449E+00, ...
    -0.3661210439903887E+00, -0.6228621851378309E+00, ...
    0.6948006452003260E+00, 0.9310681159823312E+00, ...
    -0.1927229482124843E+00, 0.9395909910668155E+00, ...
    0.8918846544837020E+00, 0.5046559139572118E+00, ...
    0.5501818316586664E+00, 0.9816538375537931E+00, ...
    -0.5810740673825336E-01, 0.9917476914762476E+00, ...
    -0.1619246931269224E+00, -0.4044274445105527E+00, ...
    -0.9788832392715772E+00, -0.2896262066021671E+00, ...
    0.9979092625656895E+00, 0.9953891308905385E+00 ];
  ys = [ ...
    -0.4125999616297640E+00, -0.3577512709695355E+00, ...
    -0.4586571513966052E+00, -0.8809700870302296E+00, ...
    0.6141953888878622E+00, -0.1098686336047354E-01, ...
    -0.2992063293298189E+00, -0.5784543682045333E+00, ...
    0.1546499308353232E+00, 0.4744749166521733E+00, ...
    0.6850785787653841E+00, 0.3498227222335277E+00, ...
    -0.3706543545438595E-01, 0.9489055210853593E+00, ...
    -0.8258138282634399E+00, 0.8310925689243290E+00, ...
    -0.2955546221774640E+00, -0.2274560569718798E+00, ...
    -0.7326258705118668E+00, 0.6810827567696704E+00, ...
    -0.1839671034672870E+00, 0.6471305653882479E+00, ...
    0.4545843865988449E+00, 0.2460664244382031E-01, ...
    0.1874945363707773E+00, -0.5593766578223933E+00, ...
    -0.9791589336665545E+00, -0.6283651952819381E+00, ...
    0.5755680670959202E+00, 0.2389500706336686E-01, ...
    -0.8335047675899898E+00, 0.3839430357533925E+00, ...
    -0.9053291152689182E+00, 0.3178523468094013E+00, ...
    0.1336071580769665E-01, -0.2394172411300733E+00, ...
    -0.9590729155294019E-01, 0.9385425560623889E+00, ...
    0.7891616010496042E+00, -0.8504780607583017E+00, ...
    -0.9475181655259435E+00, 0.3020909284966213E+00, ...
    -0.9580268216765446E+00, -0.9705093056943978E+00, ...
    0.7530029765856929E+00, -0.9658747597521009E+00, ...
    0.8589417682173183E+00, 0.5576404948411705E+00, ...
    -0.9193264723330097E+00, -0.7573749854479314E+00, ...
    0.7034268760540773E+00, 0.9510178717882097E+00, ...
    -0.9731097679191421E+00, -0.8322328408621713E+00, ...
    0.6019176765989178E+00, -0.4092215952731691E+00, ...
    -0.5199973715576629E+00, 0.8581532655611123E+00, ...
    0.2298310606072314E+00, -0.8504134103774321E+00, ...
    -0.9915729124045047E+00, 0.8271450907199669E+00, ...
    -0.9986629495001677E+00, 0.5886511512141286E+00, ...
    0.9903359117471948E+00, 0.4125999616297641E+00, ...
    0.3577512709695354E+00, 0.4586571513966052E+00, ...
    0.8809700870302297E+00, -0.6141953888878622E+00, ...
    0.1098686336047354E-01, 0.2992063293298190E+00, ...
    0.5784543682045332E+00, -0.1546499308353234E+00, ...
    -0.4744749166521733E+00, -0.6850785787653841E+00, ...
    -0.3498227222335276E+00, 0.3706543545438599E-01, ...
    -0.9489055210853593E+00, 0.8258138282634397E+00, ...
    -0.8310925689243290E+00, 0.2955546221774641E+00, ...
    0.2274560569718798E+00, 0.7326258705118668E+00, ...
    -0.6810827567696704E+00, 0.1839671034672870E+00, ...
    -0.6471305653882478E+00, -0.4545843865988448E+00, ...
    -0.2460664244382029E-01, -0.1874945363707773E+00, ...
    0.5593766578223933E+00, 0.9791589336665545E+00, ...
    0.6283651952819381E+00, -0.5755680670959203E+00, ...
    -0.2389500706336671E-01, 0.8335047675899898E+00, ...
    -0.3839430357533924E+00, 0.9053291152689182E+00, ...
    -0.3178523468094013E+00, -0.1336071580769660E-01, ...
    0.2394172411300734E+00, 0.9590729155294021E-01, ...
    -0.9385425560623889E+00, -0.7891616010496042E+00, ...
    0.8504780607583017E+00, 0.9475181655259436E+00, ...
    -0.3020909284966213E+00, 0.9580268216765446E+00, ...
    0.9705093056943976E+00, -0.7530029765856929E+00, ...
    0.9658747597521009E+00, -0.8589417682173183E+00, ...
    -0.5576404948411705E+00, 0.9193264723330097E+00, ...
    0.7573749854479312E+00, -0.7034268760540774E+00, ...
    -0.9510178717882097E+00, 0.9731097679191421E+00, ...
    0.8322328408621713E+00, -0.6019176765989177E+00, ...
    0.4092215952731690E+00, 0.5199973715576629E+00, ...
    -0.8581532655611123E+00, -0.2298310606072313E+00, ...
    0.8504134103774322E+00, 0.9915729124045047E+00, ...
    -0.8271450907199669E+00, 0.9986629495001677E+00, ...
    -0.5886511512141284E+00, -0.9903359117471947E+00 ];
  zs = [ ...
    0.2510431589001390E+00, -0.4730112580495535E+00, ...
    -0.8296554957987250E+00, 0.6042839304817023E+00, ...
    -0.4354086139851164E+00, 0.7512711569117528E+00, ...
    0.2580885268523619E+00, 0.7181855545442590E+00, ...
    0.7258539919433724E+00, 0.5394422830180516E+00, ...
    -0.3665937773187872E+00, -0.4287198875778774E+00, ...
    -0.1391272946798063E+00, -0.2939636504110460E+00, ...
    -0.8894944904099870E-01, 0.6509390582294805E+00, ...
    -0.8295699704108563E+00, 0.9037134226828011E-03, ...
    0.7543687304209290E+00, 0.7789156932196367E+00, ...
    0.6834706616686410E+00, -0.2649602815663506E+00, ...
    -0.6640360044523207E+00, 0.3841143167045120E+00, ...
    0.9462427733191926E+00, -0.3779968053092916E+00, ...
    0.7871565548827959E+00, 0.8953414085684869E+00, ...
    -0.9510332692943319E+00, -0.9747087096347502E+00, ...
    -0.6936472418684265E+00, -0.9725884697577191E+00, ...
    -0.9605395058198848E+00, -0.7896659742434409E+00, ...
    -0.9585765042296354E+00, 0.8915927965605104E+00, ...
    -0.5323083877061187E+00, -0.9089350785066914E+00, ...
    -0.8104031924041570E-01, 0.7186845896034352E+00, ...
    0.7635825638284459E-01, 0.2475045724812137E+00, ...
    -0.8458514443440915E+00, 0.9116524510899568E+00, ...
    -0.9030128536354431E+00, 0.5786900078194604E+00, ...
    -0.4876904077471467E+00, 0.9522425964634561E-01, ...
    -0.2288092843749514E+00, -0.4933688094107099E+00, ...
    0.6791308826513548E-01, 0.3643415241007317E+00, ...
    -0.5743612468117230E+00, -0.9410337888158190E+00, ...
    0.9256166802221193E+00, -0.9794608522159433E+00, ...
    -0.7050722652352325E+00, 0.9838945816912786E+00, ...
    -0.3456879759150185E+00, 0.9876394980104540E+00, ...
    -0.8354581552777850E+00, -0.9782936349079702E+00, ...
    0.3136198827810360E+00, 0.8542937538183871E+00, ...
    0.4938372507517853E+00, -0.2510431589001390E+00, ...
    0.4730112580495534E+00, 0.8296554957987250E+00, ...
    -0.6042839304817023E+00, 0.4354086139851165E+00, ...
    -0.7512711569117528E+00, -0.2580885268523619E+00, ...
    -0.7181855545442589E+00, -0.7258539919433724E+00, ...
    -0.5394422830180515E+00, 0.3665937773187872E+00, ...
    0.4287198875778774E+00, 0.1391272946798063E+00, ...
    0.2939636504110459E+00, 0.8894944904099869E-01, ...
    -0.6509390582294805E+00, 0.8295699704108564E+00, ...
    -0.9037134226827184E-03, -0.7543687304209290E+00, ...
    -0.7789156932196368E+00, -0.6834706616686410E+00, ...
    0.2649602815663507E+00, 0.6640360044523208E+00, ...
    -0.3841143167045120E+00, -0.9462427733191926E+00, ...
    0.3779968053092917E+00, -0.7871565548827959E+00, ...
    -0.8953414085684869E+00, 0.9510332692943317E+00, ...
    0.9747087096347502E+00, 0.6936472418684265E+00, ...
    0.9725884697577191E+00, 0.9605395058198848E+00, ...
    0.7896659742434410E+00, 0.9585765042296354E+00, ...
    -0.8915927965605104E+00, 0.5323083877061187E+00, ...
    0.9089350785066915E+00, 0.8104031924041578E-01, ...
    -0.7186845896034351E+00, -0.7635825638284455E-01, ...
    -0.2475045724812137E+00, 0.8458514443440915E+00, ...
    -0.9116524510899567E+00, 0.9030128536354431E+00, ...
    -0.5786900078194604E+00, 0.4876904077471467E+00, ...
    -0.9522425964634557E-01, 0.2288092843749515E+00, ...
    0.4933688094107098E+00, -0.6791308826513545E-01, ...
    -0.3643415241007316E+00, 0.5743612468117228E+00, ...
    0.9410337888158191E+00, -0.9256166802221192E+00, ...
    0.9794608522159431E+00, 0.7050722652352326E+00, ...
    -0.9838945816912786E+00, 0.3456879759150185E+00, ...
    -0.9876394980104540E+00, 0.8354581552777850E+00, ...
    0.9782936349079702E+00, -0.3136198827810360E+00, ...
    -0.8542937538183870E+00, -0.4938372507517853E+00 ];
  ws = [ ...
    0.3140524074284941E-01, 0.3981029681429966E-01, ...
    0.1485446788498034E-01, 0.6244986380811999E-02, ...
    0.2738837680317996E-01, 0.2157943912866181E-01, ...
    0.3558093745023824E-01, 0.3212728314491558E-01, ...
    0.3092422246858361E-01, 0.2343742079178917E-01, ...
    0.3088702409027052E-01, 0.5359064880099586E-01, ...
    0.6482379336742157E-01, 0.9118048913013883E-02, ...
    0.1301789370977779E-01, 0.2655541823663328E-01, ...
    0.3453297251160139E-01, 0.4411844784877157E-01, ...
    0.1649537886932118E-01, 0.2909276637092253E-01, ...
    0.4360788133113655E-01, 0.1053270755633742E-01, ...
    0.2277866730141684E-01, 0.1989571475016660E-01, ...
    0.1091026629930172E-01, 0.4918510213252013E-01, ...
    0.8074020956961596E-02, 0.2335968213222367E-01, ...
    0.1235756243300519E-01, 0.1499095494625247E-01, ...
    0.1701688982544987E-01, 0.1042658914550453E-01, ...
    0.4196082934549206E-02, 0.1415599321876098E-01, ...
    0.6647555404704302E-02, 0.3129197633426045E-01, ...
    0.5718706313414747E-01, 0.8214012330106898E-02, ...
    0.4800378437465311E-01, 0.2511168810726739E-01, ...
    0.1848081803186647E-01, 0.3560225217379276E-01, ...
    0.9719778448629727E-02, 0.4568238333579292E-02, ...
    0.3878678624072500E-02, 0.6252926394948910E-02, ...
    0.3458846268652847E-01, 0.6444154518560745E-01, ...
    0.2421665637314795E-01, 0.3403670963655146E-01, ...
    0.2101561337278881E-01, 0.2321281908800168E-01, ...
    0.4914553718764686E-02, 0.6665400363164401E-02, ...
    0.2231229502988629E-01, 0.1251715201913546E-01, ...
    0.9481650136297978E-02, 0.8059627544061664E-02, ...
    0.1180468380164612E-01, 0.7820767064272208E-02, ...
    0.6958745625819240E-02, 0.2234878561766285E-02, ...
    0.1024235452666042E-01, 0.5000286844891411E-02, ...
    0.2657409809447695E-02, 0.3140524074284939E-01, ...
    0.3981029681429966E-01, 0.1485446788498035E-01, ...
    0.6244986380811991E-02, 0.2738837680317996E-01, ...
    0.2157943912866178E-01, 0.3558093745023824E-01, ...
    0.3212728314491559E-01, 0.3092422246858360E-01, ...
    0.2343742079178915E-01, 0.3088702409027051E-01, ...
    0.5359064880099586E-01, 0.6482379336742154E-01, ...
    0.9118048913013897E-02, 0.1301789370977778E-01, ...
    0.2655541823663329E-01, 0.3453297251160137E-01, ...
    0.4411844784877157E-01, 0.1649537886932117E-01, ...
    0.2909276637092255E-01, 0.4360788133113656E-01, ...
    0.1053270755633743E-01, 0.2277866730141684E-01, ...
    0.1989571475016661E-01, 0.1091026629930171E-01, ...
    0.4918510213252012E-01, 0.8074020956961608E-02, ...
    0.2335968213222367E-01, 0.1235756243300520E-01, ...
    0.1499095494625249E-01, 0.1701688982544985E-01, ...
    0.1042658914550453E-01, 0.4196082934549209E-02, ...
    0.1415599321876098E-01, 0.6647555404704300E-02, ...
    0.3129197633426043E-01, 0.5718706313414745E-01, ...
    0.8214012330106886E-02, 0.4800378437465309E-01, ...
    0.2511168810726739E-01, 0.1848081803186646E-01, ...
    0.3560225217379277E-01, 0.9719778448629732E-02, ...
    0.4568238333579302E-02, 0.3878678624072491E-02, ...
    0.6252926394948914E-02, 0.3458846268652847E-01, ...
    0.6444154518560744E-01, 0.2421665637314794E-01, ...
    0.3403670963655148E-01, 0.2101561337278882E-01, ...
    0.2321281908800168E-01, 0.4914553718764693E-02, ...
    0.6665400363164389E-02, 0.2231229502988629E-01, ...
    0.1251715201913550E-01, 0.9481650136297967E-02, ...
    0.8059627544061670E-02, 0.1180468380164611E-01, ...
    0.7820767064272205E-02, 0.6958745625819234E-02, ...
    0.2234878561766282E-02, 0.1024235452666043E-01, ...
    0.5000286844891406E-02, 0.2657409809447699E-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
