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 = [ ...
    -0.4777385017466611E-01,-0.7568808830760128, ...
    0.8046547332507396,0.3005907944967990E-01, ...
    -0.3472424886466524,0.3171834091971876, ...
    -0.3529824413110864E-01,-0.4209487812102883, ...
    0.4562470253414500,-0.7153537080888878, ...
    0.5989558965388279,0.1163978115501301, ...
    0.3710519456025519E-02,0.4652335033519287, ...
    -0.4689440228078527,-0.3599160575353618E-01, ...
    0.1939924024452817,-0.1580007966914678, ...
    -0.2161537359848647E-01,0.2912599485905940, ...
    -0.2696445749921000,-0.4913573074965884, ...
    0.2288888183023164,0.2624684891944182, ...
    -0.1426281098822192,-0.3118486240867259, ...
    0.4544767339690260,0.7618754763810419, ...
    -0.1422306180040716,-0.6196448583768703, ...
    0.5776897880027803E-01,0.1164689180950719, ...
    -0.1742378968955057,-0.1414719142296262, ...
    -0.3229372289650024,0.4644091431945710, ...
    -0.1398258170326137,-0.5098850522745304, ...
    0.6497108693071825,0.3610318921371553, ...
    0.1054629929099188,-0.4664948850470391, ...
    0.2459013465212476E-01,-0.7178146556427887, ...
    0.6932245209907225,-0.1065595141175732E-01, ...
    -0.9217121855780308,0.9323681369897492, ...
    -0.4115285528872360,0.2668526805669106, ...
    0.1446758723202021,0.1571190412397715E-02, ...
    -0.6922217370423006E-01,0.6765098329171684E-01, ...
    -0.2991189861629327,-0.1245621803681009, ...
    0.4236811665311025,0.3871696430393148, ...
    0.1500785041234294,-0.5372481471625822, ...
    -0.8064886300342536E-01,-0.4844598247542774, ...
    0.5651086877577737,0.6705603853993255, ...
    -0.2613693382805031,-0.4091910471186840, ...
    -0.2994914861160214,-0.2674832138785850, ...
    0.5669746999946459,0.4510147973428894E-01, ...
    0.2172069032075606,-0.2623083829418457, ...
    -0.2495785492724049,-0.2085110500880744, ...
    0.4580895993605156,0.2707504828489703, ...
    -0.4821600751443009,0.2114095922954477, ...
    -0.4554280384514680E-01,-0.7996627976605564, ...
    0.8452056015056444,0.2029674430134095E-01, ...
    -0.7997175993984930,0.7794208550971885, ...
    0.1441756236446537,-0.6915442312985614, ...
    0.5473686076540003,0.3528170518753222E-01, ...
    -0.3311753761570134,0.2958936709696454, ...
    -0.7827835701762442E-02,0.2760083802741976, ...
    -0.2681805445724308,0.6806655606966093E-01, ...
    -0.5973241026022454,0.5292575465325308, ...
    -0.9685067665231929E-01,0.2259602937925122, ...
    -0.1291096171402099,-0.1001708030503953E-01, ...
    -0.5630399697700922,0.5730570500751420, ...
    0.3465920273834422E-01,-0.1777529113458167, ...
    0.1430937086076311,0.7285263734559304E-01, ...
    -0.8758889229618175,0.8030362856162614, ...
    0.1343389663918027,0.3445210697535890, ...
    -0.4788600361453874,-0.1348321313217423E-01, ...
    0.1154680832801965,-0.1019848701479677, ...
    -0.5176848990301737E-01,-0.2375948027597131, ...
    0.2893632926627010,0.1729207472857360E-01, ...
    -0.4389324777852445,0.4216404030566085, ...
    -0.3914791775164566E-02,-0.2309684344749786, ...
    0.2348832262501366,-0.6881144138718593, ...
    0.4266860230809687,0.2614283907909357, ...
    0.4960973006288234E-02,-0.2137441872471665, ...
    0.2087832142407756,-0.7325006065249269E-01, ...
    -0.2659488483143491,0.3391989089668666, ...
    -0.4678501489682662E-01,-0.5410293892575722, ...
    0.5878144041543488,-0.2500405721723705E-01, ...
    -0.6313699376952513,0.6563739949124212, ...
    0.1364199568193839,-0.2996193314702689, ...
    0.1631993746509763,0.1198743702984181E-12, ...
    -0.7662979863046558E-13,-0.4829662024390088E-14, ...
    -0.2111050829994401E-13,-0.1270671025297558E-13 ];
  ys = [ ...
    0.9015530084355994,-0.4921498721057091, ...
    -0.4094031363297998,0.3836064709764307, ...
    -0.1657713090704851,-0.2178351619061508, ...
    0.5064492350445715,-0.2837937936488191, ...
    -0.2226554413958301,-0.2786050402678961, ...
    -0.4802119637624816,0.7588170040302994, ...
    -0.5393476461992264,0.2728872272096964, ...
    0.2664604189895141,-0.2032233682745297, ...
    0.7044203923151297E-01,0.1327813290428652, ...
    -0.3238383776801540,0.1431997261914898, ...
    0.1806386514886541,0.1938723202896774E-01, ...
    -0.4352215266416702,0.4158342946127344, ...
    0.4424381517603146,-0.3447386423319839, ...
    -0.9769950942847148E-01,-0.2756352401942940, ...
    0.7976211371634238,-0.5219858969692130, ...
    -0.1678396578899558,0.1339492321368408, ...
    0.3389042575316226E-01,0.4545746399118207, ...
    -0.3498055916007531,-0.1047690483110467, ...
    0.6694930174765074,-0.4558392183934259, ...
    -0.2136537990830517,-0.3302200348036231, ...
    0.4777728075688429,-0.1475527727653846, ...
    0.8146638484662959,-0.3860362429420576, ...
    -0.4286276055244945,0.1070453773333782E+01, ...
    -0.5444552112909320,-0.5259985620427312, ...
    -0.7053881312997473E-01,-0.3211247746179037, ...
    0.3916635877479940,0.7902375403647920E-01, ...
    -0.3815118620693258E-01,-0.4087256782951131E-01, ...
    0.3165284439137526,-0.4173088627282204, ...
    0.1007804188144937,-0.3968282271412536, ...
    0.5337128600166933,-0.1368846328756112, ...
    0.6059686632316962,-0.3728282957631877, ...
    -0.2331403674686730,-0.8534490338988292E-01, ...
    0.6233947802222222,-0.5380498768323672, ...
    0.4817745012020841,-0.5002544857946896, ...
    0.1847998459249884E-01,-0.2768482795388788, ...
    0.1774831669675317,0.9936511257127259E-01, ...
    0.3848620644010382,-0.4085723961101285, ...
    0.2371033170906487E-01,0.4004326341980497, ...
    0.3426047913492075E-01,-0.4346931133331124, ...
    0.9496652130401684,-0.5142738316095435, ...
    -0.4353913814305450,0.9117160117907287, ...
    -0.4382805097163334,-0.4734355020744341, ...
    0.7152866610716716,-0.2327835778531099, ...
    -0.4825030832186010,0.3620384831590592, ...
    -0.1504643885983839,-0.2115740945607743, ...
    -0.3141876222502283,0.1503147065506677, ...
    0.1638729156994478,0.6504322183920584, ...
    -0.2662687424915907,-0.3841634759004985, ...
    -0.2049997086581880,0.1862470797446676E-01, ...
    0.1863750006837488,0.6559259202331654, ...
    -0.3366380061325622,-0.3192879141007369, ...
    0.1852408823986869,-0.6260469115301880E-01, ...
    -0.1226361912458057,0.9693279211217602, ...
    -0.4215717258868716,-0.5477561952349157, ...
    -0.4753793031363919,0.3540306091815932, ...
    0.1213486939547357,-0.1255465211978510, ...
    0.5109645550180968E-01,0.7445006569601835E-01, ...
    0.3042393982437668,-0.1969525264934776, ...
    -0.1072868717503699,0.4968519844113532, ...
    -0.2334506162065882,-0.2634013682047193, ...
    0.2689595817220580,-0.1378700999889159, ...
    -0.1310894817332517,-0.9541153848828572E-01, ...
    -0.5482187938791565,0.6436303323674273, ...
    0.2439463089891027,-0.1176768258436301, ...
    -0.1262694831454210,0.3493822205657847, ...
    -0.2381275236366834,-0.1112546969291192, ...
    0.6517382679995124,-0.3663861454168269, ...
    -0.2853521225825763,0.7434793061384100, ...
    -0.3933938018169897,-0.3500855043213671, ...
    0.2672085045651081,-0.1546110409379758E-01, ...
    -0.2517474004713509,-0.6195967642546056E-13, ...
    0.3002370388193685E-13,-0.5457794979132388E-13, ...
    0.1164494042115649E-12,0.3123283355285955E-13 ];
  zs = [ ...
    -0.2327715323996341,-0.2327715323996078, ...
    -0.2327715323995431,0.3496762696550786, ...
    0.3496762696549099,0.3496762696549561, ...
    0.2717988565409110,0.2717988565409942, ...
    0.2717988565407555,-0.3874128688211647, ...
    -0.3874128688212131,-0.3874128688212028, ...
    -0.3783145937148669,-0.3783145937148664, ...
    -0.3783145937148837,-0.3908054363428844, ...
    -0.3908054363428517,-0.3908054363428521, ...
    0.2214621132658698,0.2214621132658886, ...
    0.2214621132658825,-0.5332156026748039E-01, ...
    -0.5332156026744841E-01,-0.5332156026745260E-01, ...
    -0.1366126720097484,-0.1366126720097481, ...
    -0.1366126720097814,-0.3405718815923187, ...
    -0.3405718815923307,-0.3405718815923774, ...
    0.2482158558753812,0.2482158558753821, ...
    0.2482158558753401,0.1493078550521198, ...
    0.1493078550521607,0.1493078550521824, ...
    -0.1246861001425667,-0.1246861001425311, ...
    -0.1246861001424509,-0.8804090671666169E-01, ...
    -0.8804090671661184E-01,-0.8804090671646460E-01, ...
    -0.2903904416529835,-0.2903904416529482, ...
    -0.2903904416530703,-0.3588716811515187, ...
    -0.3588716811515073,-0.3588716811515079, ...
    0.1748649644824907,0.1748649644825259, ...
    0.1748649644824762,0.1005626022480115E+01, ...
    0.1005626022480066E+01,0.1005626022480308E+01, ...
    -0.6085363845277859E-01,-0.6085363845275459E-01, ...
    -0.6085363845275343E-01,-0.2907416212662024, ...
    -0.2907416212662147,-0.2907416212661059, ...
    -0.2928675049685535,-0.2928675049684912, ...
    -0.2928675049686165,-0.3986190384060752, ...
    -0.3986190384060841,-0.3986190384061074, ...
    -0.2763005028815692,-0.2763005028815834, ...
    -0.2763005028815310,-0.3171132373617958E-01, ...
    -0.3171132373613690E-01,-0.3171132373618723E-01, ...
    -0.3670072924650872,-0.3670072924650821, ...
    -0.3670072924650642,-0.3918966809387769, ...
    -0.3918966809387540,-0.3918966809387686, ...
    -0.3945112928982144,-0.3945112928982283, ...
    -0.3945112928982709,-0.1689813827450514, ...
    -0.1689813827450869,-0.1689813827450585, ...
    -0.1988456360856388,-0.1988456360856537, ...
    -0.1988456360856610,-0.3581788966687771, ...
    -0.3581788966687613,-0.3581788966687278, ...
    -0.2652570624981906,-0.2652570624981415, ...
    -0.2652570624981432,0.9127655651197962E-01, ...
    0.9127655651192465E-01,0.9127655651200027E-01, ...
    0.4712027028361149,0.4712027028361768, ...
    0.4712027028361248,-0.4789101434801453E-01, ...
    -0.4789101434802212E-01,-0.4789101434808656E-01, ...
    0.5562071598537035,0.5562071598536467, ...
    0.5562071598533351,-0.3666902411131864, ...
    -0.3666902411132085,-0.3666902411132190, ...
    -0.2500081968302335,-0.2500081968302558, ...
    -0.2500081968302762,0.7953910781041313, ...
    0.7953910781041719,0.7953910781041406, ...
    0.1246295654192337,0.1246295654192380, ...
    0.1246295654192949,0.4430780439124138, ...
    0.4430780439124452,0.4430780439125641, ...
    -0.1789190687389412,-0.1789190687388659, ...
    -0.1789190687388622,-0.3621753277358900, ...
    -0.3621753277358689,-0.3621753277358712, ...
    0.7590201625172059,0.7590201625171641, ...
    0.7590201625173268,0.5385097619725802, ...
    0.5385097619725214,0.5385097619724014, ...
    -0.4034889863680245,-0.4034889863679839, ...
    -0.4034889863680722,0.9129480050841532E-01, ...
    0.9129480050844316E-01,0.9129480050850451E-01, ...
    0.5076476008019328,0.5076476008020036, ...
    0.5076476008019484,0.7587686360919684, ...
    0.1174064403165666E+01,-0.2917588131252908, ...
    0.4072850512806022,-0.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
