function [ x, w ] = rule13 ( n )

%*****************************************************************************80
%
%% RULE13 returns the rule of degree 13.
%
%  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 = [ ...
    -.4777385017466611E-01,-.7568808830760128, ...
    0.8046547332507396,0.3005907944967990E-01, ...
    -.3472424886466524,0.3171834091971876, ...
    -.3529824413110864E-01,-.4209487812102883, ...
    0.4562470253414500,-.7153537080888878, ...
    0.5989558965388279,0.1163978115501301, ...
    0.3710519456025519E-02,0.4652335033519287, ...
    -.4689440228078527,-.3599160575353618E-01, ...
    0.1939924024452817,-.1580007966914678, ...
    -.2161537359848647E-01,0.2912599485905940, ...
    -.2696445749921000,-.4913573074965884, ...
    0.2288888183023164,0.2624684891944182, ...
    -.1426281098822192,-.3118486240867259, ...
    0.4544767339690260,0.7618754763810419, ...
    -.1422306180040716,-.6196448583768703, ...
    0.5776897880027803E-01,0.1164689180950719, ...
    -.1742378968955057,-.1414719142296262, ...
    -.3229372289650024,0.4644091431945710, ...
    -.1398258170326137,-.5098850522745304, ...
    0.6497108693071825,0.3610318921371553, ...
    0.1054629929099188,-.4664948850470391, ...
    0.2459013465212476E-01,-.7178146556427887, ...
    0.6932245209907225,-.1065595141175732E-01, ...
    -.9217121855780308,0.9323681369897492, ...
    -.4115285528872360,0.2668526805669106, ...
    0.1446758723202021,0.1571190412397715E-02, ...
    -.6922217370423006E-01,0.6765098329171684E-01, ...
    -.2991189861629327,-.1245621803681009, ...
    0.4236811665311025,0.3871696430393148, ...
    0.1500785041234294,-.5372481471625822, ...
    -.8064886300342536E-01,-.4844598247542774, ...
    0.5651086877577737,0.6705603853993255, ...
    -.2613693382805031,-.4091910471186840, ...
    -.2994914861160214,-.2674832138785850, ...
    0.5669746999946459,0.4510147973428894E-01, ...
    0.2172069032075606,-.2623083829418457, ...
    -.2495785492724049,-.2085110500880744, ...
    0.4580895993605156,0.2707504828489703, ...
    -.4821600751443009,0.2114095922954477, ...
    -.4554280384514680E-01,-.7996627976605564, ...
    0.8452056015056444,0.2029674430134095E-01, ...
    -.7997175993984930,0.7794208550971885, ...
    0.1441756236446537,-.6915442312985614, ...
    0.5473686076540003,0.3528170518753222E-01, ...
    -.3311753761570134,0.2958936709696454, ...
    -.7827835701762442E-02,0.2760083802741976, ...
    -.2681805445724308,0.6806655606966093E-01, ...
    -.5973241026022454,0.5292575465325308, ...
    -.9685067665231929E-01,0.2259602937925122, ...
    -.1291096171402099,-.1001708030503953E-01, ...
    -.5630399697700922,0.5730570500751420, ...
    0.3465920273834422E-01,-.1777529113458167, ...
    0.1430937086076311,0.7285263734559304E-01, ...
    -.8758889229618175,0.8030362856162614, ...
    0.1343389663918027,0.3445210697535890, ...
    -.4788600361453874,-.1348321313217423E-01, ...
    0.1154680832801965,-.1019848701479677, ...
    -.5176848990301737E-01,-.2375948027597131, ...
    0.2893632926627010,0.1729207472857360E-01, ...
    -.4389324777852445,0.4216404030566085, ...
    -.3914791775164566E-02,-.2309684344749786, ...
    0.2348832262501366,-.6881144138718593, ...
    0.4266860230809687,0.2614283907909357, ...
    0.4960973006288234E-02,-.2137441872471665, ...
    0.2087832142407756,-.7325006065249269E-01, ...
    -.2659488483143491,0.3391989089668666, ...
    -.4678501489682662E-01,-.5410293892575722, ...
    0.5878144041543488,-.2500405721723705E-01, ...
    -.6313699376952513,0.6563739949124212, ...
    0.1364199568193839,-.2996193314702689, ...
    0.1631993746509763,0.1198743702984181D-12, ...
    -.7662979863046558D-13,-.4829662024390088D-14, ...
    -.2111050829994401D-13,-.1270671025297558D-13 ];
  ys = [ ...
    0.9015530084355994,-.4921498721057091, ...
    -.4094031363297998,0.3836064709764307, ...
    -.1657713090704851,-.2178351619061508, ...
    0.5064492350445715,-.2837937936488191, ...
    -.2226554413958301,-.2786050402678961, ...
    -.4802119637624816,0.7588170040302994, ...
    -.5393476461992264,0.2728872272096964, ...
    0.2664604189895141,-.2032233682745297, ...
    0.7044203923151297E-01,0.1327813290428652, ...
    -.3238383776801540,0.1431997261914898, ...
    0.1806386514886541,0.1938723202896774E-01, ...
    -.4352215266416702,0.4158342946127344, ...
    0.4424381517603146,-.3447386423319839, ...
    -.9769950942847148E-01,-.2756352401942940, ...
    0.7976211371634238,-.5219858969692130, ...
    -.1678396578899558,0.1339492321368408, ...
    0.3389042575316226E-01,0.4545746399118207, ...
    -.3498055916007531,-.1047690483110467, ...
    0.6694930174765074,-.4558392183934259, ...
    -.2136537990830517,-.3302200348036231, ...
    0.4777728075688429,-.1475527727653846, ...
    0.8146638484662959,-.3860362429420576, ...
    -.4286276055244945,0.1070453773333782D+01, ...
    -.5444552112909320,-.5259985620427312, ...
    -.7053881312997473E-01,-.3211247746179037, ...
    0.3916635877479940,0.7902375403647920E-01, ...
    -.3815118620693258E-01,-.4087256782951131E-01, ...
    0.3165284439137526,-.4173088627282204, ...
    0.1007804188144937,-.3968282271412536, ...
    0.5337128600166933,-.1368846328756112, ...
    0.6059686632316962,-.3728282957631877, ...
    -.2331403674686730,-.8534490338988292E-01, ...
    0.6233947802222222,-.5380498768323672, ...
    0.4817745012020841,-.5002544857946896, ...
    0.1847998459249884E-01,-.2768482795388788, ...
    0.1774831669675317,0.9936511257127259E-01, ...
    0.3848620644010382,-.4085723961101285, ...
    0.2371033170906487E-01,0.4004326341980497, ...
    0.3426047913492075E-01,-.4346931133331124, ...
    0.9496652130401684,-.5142738316095435, ...
    -.4353913814305450,0.9117160117907287, ...
    -.4382805097163334,-.4734355020744341, ...
    0.7152866610716716,-.2327835778531099, ...
    -.4825030832186010,0.3620384831590592, ...
    -.1504643885983839,-.2115740945607743, ...
    -.3141876222502283,0.1503147065506677, ...
    0.1638729156994478,0.6504322183920584, ...
    -.2662687424915907,-.3841634759004985, ...
    -.2049997086581880,0.1862470797446676E-01, ...
    0.1863750006837488,0.6559259202331654, ...
    -.3366380061325622,-.3192879141007369, ...
    0.1852408823986869,-.6260469115301880E-01, ...
    -.1226361912458057,0.9693279211217602, ...
    -.4215717258868716,-.5477561952349157, ...
    -.4753793031363919,0.3540306091815932, ...
    0.1213486939547357,-.1255465211978510, ...
    0.5109645550180968E-01,0.7445006569601835E-01, ...
    0.3042393982437668,-.1969525264934776, ...
    -.1072868717503699,0.4968519844113532, ...
    -.2334506162065882,-.2634013682047193, ...
    0.2689595817220580,-.1378700999889159, ...
    -.1310894817332517,-.9541153848828572E-01, ...
    -.5482187938791565,0.6436303323674273, ...
    0.2439463089891027,-.1176768258436301, ...
    -.1262694831454210,0.3493822205657847, ...
    -.2381275236366834,-.1112546969291192, ...
    0.6517382679995124,-.3663861454168269, ...
    -.2853521225825763,0.7434793061384100, ...
    -.3933938018169897,-.3500855043213671, ...
    0.2672085045651081,-.1546110409379758E-01, ...
    -.2517474004713509,-.6195967642546056D-13, ...
    0.3002370388193685D-13,-.5457794979132388D-13, ...
    0.1164494042115649D-12,0.3123283355285955D-13 ];
  zs = [ ...
    -.2327715323996341,-.2327715323996078, ...
    -.2327715323995431,0.3496762696550786, ...
    0.3496762696549099,0.3496762696549561, ...
    0.2717988565409110,0.2717988565409942, ...
    0.2717988565407555,-.3874128688211647, ...
    -.3874128688212131,-.3874128688212028, ...
    -.3783145937148669,-.3783145937148664, ...
    -.3783145937148837,-.3908054363428844, ...
    -.3908054363428517,-.3908054363428521, ...
    0.2214621132658698,0.2214621132658886, ...
    0.2214621132658825,-.5332156026748039E-01, ...
    -.5332156026744841E-01,-.5332156026745260E-01, ...
    -.1366126720097484,-.1366126720097481, ...
    -.1366126720097814,-.3405718815923187, ...
    -.3405718815923307,-.3405718815923774, ...
    0.2482158558753812,0.2482158558753821, ...
    0.2482158558753401,0.1493078550521198, ...
    0.1493078550521607,0.1493078550521824, ...
    -.1246861001425667,-.1246861001425311, ...
    -.1246861001424509,-.8804090671666169E-01, ...
    -.8804090671661184E-01,-.8804090671646460E-01, ...
    -.2903904416529835,-.2903904416529482, ...
    -.2903904416530703,-.3588716811515187, ...
    -.3588716811515073,-.3588716811515079, ...
    0.1748649644824907,0.1748649644825259, ...
    0.1748649644824762,0.1005626022480115D+01, ...
    0.1005626022480066D+01,0.1005626022480308D+01, ...
    -.6085363845277859E-01,-.6085363845275459E-01, ...
    -.6085363845275343E-01,-.2907416212662024, ...
    -.2907416212662147,-.2907416212661059, ...
    -.2928675049685535,-.2928675049684912, ...
    -.2928675049686165,-.3986190384060752, ...
    -.3986190384060841,-.3986190384061074, ...
    -.2763005028815692,-.2763005028815834, ...
    -.2763005028815310,-.3171132373617958E-01, ...
    -.3171132373613690E-01,-.3171132373618723E-01, ...
    -.3670072924650872,-.3670072924650821, ...
    -.3670072924650642,-.3918966809387769, ...
    -.3918966809387540,-.3918966809387686, ...
    -.3945112928982144,-.3945112928982283, ...
    -.3945112928982709,-.1689813827450514, ...
    -.1689813827450869,-.1689813827450585, ...
    -.1988456360856388,-.1988456360856537, ...
    -.1988456360856610,-.3581788966687771, ...
    -.3581788966687613,-.3581788966687278, ...
    -.2652570624981906,-.2652570624981415, ...
    -.2652570624981432,0.9127655651197962E-01, ...
    0.9127655651192465E-01,0.9127655651200027E-01, ...
    0.4712027028361149,0.4712027028361768, ...
    0.4712027028361248,-.4789101434801453E-01, ...
    -.4789101434802212E-01,-.4789101434808656E-01, ...
    0.5562071598537035,0.5562071598536467, ...
    0.5562071598533351,-.3666902411131864, ...
    -.3666902411132085,-.3666902411132190, ...
    -.2500081968302335,-.2500081968302558, ...
    -.2500081968302762,0.7953910781041313, ...
    0.7953910781041719,0.7953910781041406, ...
    0.1246295654192337,0.1246295654192380, ...
    0.1246295654192949,0.4430780439124138, ...
    0.4430780439124452,0.4430780439125641, ...
    -.1789190687389412,-.1789190687388659, ...
    -.1789190687388622,-.3621753277358900, ...
    -.3621753277358689,-.3621753277358712, ...
    0.7590201625172059,0.7590201625171641, ...
    0.7590201625173268,0.5385097619725802, ...
    0.5385097619725214,0.5385097619724014, ...
    -.4034889863680245,-.4034889863679839, ...
    -.4034889863680722,0.9129480050841532E-01, ...
    0.9129480050844316E-01,0.9129480050850451E-01, ...
    0.5076476008019328,0.5076476008020036, ...
    0.5076476008019484,0.7587686360919684, ...
    0.1174064403165666D+01,-.2917588131252908, ...
    0.4072850512806022,-.2737975651676979E-02 ];
  ws = [ ...
    0.2068909148962774E-02,0.2068909148960302E-02, ...
    0.2068909148962221E-02,0.6862179883351744E-02, ...
    0.6862179883357749E-02,0.6862179883341077E-02, ...
    0.4745055930506758E-02,0.4745055930499521E-02, ...
    0.4745055930498638E-02,0.2639271833496386E-02, ...
    0.2639271833492975E-02,0.2639271833493415E-02, ...
    0.2420284628312029E-02,0.2420284628310808E-02, ...
    0.2420284628311964E-02,0.5428029730193044E-02, ...
    0.5428029730198515E-02,0.5428029730197811E-02, ...
    0.7363269664287002E-02,0.7363269664287796E-02, ...
    0.7363269664288242E-02,0.4622589345403796E-02, ...
    0.4622589345400746E-02,0.4622589345402929E-02, ...
    0.1113014179512893E-01,0.1113014179512515E-01, ...
    0.1113014179513268E-01,0.3019898782414975E-02, ...
    0.3019898782415646E-02,0.3019898782415196E-02, ...
    0.1497918593186746E-01,0.1497918593186317E-01, ...
    0.1497918593186622E-01,0.6570279132551560E-02, ...
    0.6570279132554112E-02,0.6570279132553927E-02, ...
    0.4504033084972921E-02,0.4504033084968776E-02, ...
    0.4504033084972839E-02,0.1239429415995445E-01, ...
    0.1239429415996196E-01,0.1239429415995679E-01, ...
    0.5367281142254301E-02,0.5367281142251953E-02, ...
    0.5367281142250357E-02,0.6316169904420855E-03, ...
    0.6316169904431759E-03,0.6316169904440820E-03, ...
    0.8876101030265546E-02,0.8876101030282007E-02, ...
    0.8876101030274161E-02,0.2162421606464688E-02, ...
    0.2162421606465037E-02,0.2162421606462924E-02, ...
    0.8054280667477870E-02,0.8054280667477506E-02, ...
    0.8054280667478849E-02,0.9049885628396499E-02, ...
    0.9049885628398672E-02,0.9049885628405025E-02, ...
    0.9196546074381425E-02,0.9196546074380063E-02, ...
    0.9196546074381355E-02,0.1389679560298547E-02, ...
    0.1389679560298251E-02,0.1389679560296835E-02, ...
    0.5469361348986402E-02,0.5469361348984248E-02, ...
    0.5469361348984599E-02,0.1725450508839409E-01, ...
    0.1725450508839278E-01,0.1725450508839148E-01, ...
    0.6733913747887457E-02,0.6733913747885728E-02, ...
    0.6733913747886398E-02,0.4022564578398640E-02, ...
    0.4022564578402713E-02,0.4022564578399363E-02, ...
    0.1301944787144861E-02,0.1301944787144253E-02, ...
    0.1301944787143136E-02,0.2027792916616635E-02, ...
    0.2027792916617886E-02,0.2027792916616735E-02, ...
    0.4379548102164245E-02,0.4379548102164029E-02, ...
    0.4379548102160293E-02,0.9788773323829804E-02, ...
    0.9788773323830982E-02,0.9788773323832441E-02, ...
    0.1491498412616913E-01,0.1491498412617151E-01, ...
    0.1491498412617137E-01,0.3816494659634458E-02, ...
    0.3816494659634902E-02,0.3816494659631925E-02, ...
    0.1053753256419563E-01,0.1053753256419800E-01, ...
    0.1053753256419685E-01,0.9378412737876001E-02, ...
    0.9378412737873921E-02,0.9378412737876034E-02, ...
    0.1034943926448387E-01,0.1034943926449078E-01, ...
    0.1034943926449734E-01,0.1253515438165336E-02, ...
    0.1253515438163976E-02,0.1253515438162651E-02, ...
    0.7631115735488028E-02,0.7631115735488942E-02, ...
    0.7631115735487678E-02,0.4662247664665583E-02, ...
    0.4662247664663175E-02,0.4662247664669866E-02, ...
    0.1924508745358327E-01,0.1924508745357723E-01, ...
    0.1924508745358518E-01,0.2150599791391388E-02, ...
    0.2150599791389261E-02,0.2150599791389503E-02, ...
    0.1815794181007045E-01,0.1815794181007355E-01, ...
    0.1815794181007060E-01,0.2074509937828351E-02, ...
    0.2074509937826631E-02,0.2074509937827053E-02, ...
    0.3856301126724407E-02,0.3856301126725213E-02, ...
    0.3856301126727490E-02,0.2342776832115179E-02, ...
    0.2342776832117610E-02,0.2342776832119853E-02, ...
    0.2485903899501151E-02,0.2485903899504086E-02, ...
    0.2485903899497665E-02,0.1958269886432824E-02, ...
    0.1958269886433108E-02,0.1958269886434393E-02, ...
    0.3112037442333638E-02,0.3112037442336383E-02, ...
    0.3112037442329971E-02,0.8380938111968996E-02, ...
    0.2408616607470909E-03,0.1651223797192308E-01, ...
    0.1363274166717042E-01,0.2507433395640973E-01 ];

  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
