function [ x, w ] = rule12 ( n )

%*****************************************************************************80
%
%% RULE12 returns the rule of degree 12.
%
%  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.3958544098912666,-.4870511331351648, ...
    0.9119672324389515E-01,-.5926431804946591, ...
    0.5193516147881150,0.7329156570653904E-01, ...
    -.4544141850245140E-01,-.2756993864806933, ...
    0.3211408049831440,-.3413860630862161, ...
    0.5248742662396945,-.1834882031534880, ...
    -.1319722431139201,0.2771078804366659, ...
    -.1451356373227354,0.2916719156941026, ...
    -.6416905801467393,0.3500186644526196, ...
    -.4070439485536645E-01,-.4815006651936328, ...
    0.5222050600490048,-.9820856549819251E-01, ...
    -.4276075601779065,0.5258161256761047, ...
    0.2184089033681613,-.4656593625800790, ...
    0.2472504592119225,-.6606777491144762E-02, ...
    0.1271987824323769,-.1205920049412379, ...
    -.1862346674942773,-.1097662119993451, ...
    0.2960008794936306,-.5890402754221185, ...
    0.6424505517737594,-.5341027635165645E-01, ...
    -.1196400210307819E-01,-.7808240524677493, ...
    0.7927880545708264,0.6235239461686299E-01, ...
    -.4408318818916021,0.3784794872747496, ...
    0.2235903863093564,-.5240787479715297E-01, ...
    -.1711825115122079,0.1666477050331823, ...
    -.2729955606600447,0.1063478556268736, ...
    -.7415049139037595E-01,0.7389518464069887E-01, ...
    0.2553067496801190E-03,0.1955908717228039, ...
    0.1141488778114551,-.3097397495342445, ...
    -.1802680258591541E-01,-.2161777731993448, ...
    0.2342045757852541,-.1532613811702923, ...
    -.1800985367097719,0.3333599178800782, ...
    0.5776336665233524E-02,-.6762886678803212, ...
    0.6705123312150877,-.8304590790913337E-01, ...
    0.3554044991859694,-.2723585912768360, ...
    0.5423845315967933,-.2526088517557438, ...
    -.2897756798410528,0.5573431967310101, ...
    -.3595768372350124,-.1977663594959926, ...
    0.4731366238769863,-.1975148047452081E-01, ...
    -.4533851434024622,0.3153219324427421, ...
    -.2494039878683618E-01,-.2903815336558955, ...
    -.1831653764008917E-01,-.9317223914837645, ...
    0.9500389291238570,-.6699974553713883, ...
    0.5322783600952914,0.1377190952760970, ...
    0.2782783282780965,-.3217122219145910, ...
    0.4343389363650290E-01,0.9746770878915403E-01, ...
    -.3733686186921615,0.2759009099030095, ...
    0.1089081465931238E-01,-.8195375330783097, ...
    0.8086467184189974,-.1251938886030335, ...
    0.3429675592810749E-01,0.9089713267491691E-01, ...
    0.4868852723886817,0.1198290818690802, ...
    -.6067143542577578,0.3382540465835279, ...
    -.4603539675728300,0.1220999209893009, ...
    -.9480210749913888E-01,-.6451285680033118, ...
    0.7399306755024498,0.1140113067761596, ...
    -.8552704011446526,0.7412590943684850, ...
    -.1658421801556803,-.6245895743792733, ...
    0.7904317545349575,0.2557413056493574, ...
    0.3270954418922731E-01,-.2884508498385872, ...
    -.1613157569571640,-.4583565335140027, ...
    0.6196722904711670,0.2156998987651826D-14, ...
    0.2157685773910294D-14,0.9329761593328095D-14, ...
    -.1937826095544789D-14,0.5112100598082816D-14 ];
  ys = [ ...
    0.3338515555387722,0.1758941973965540, ...
    -.5097457529353365,-.2575328894119814, ...
    -.3844776049819921,0.6420104943939733, ...
    0.3445858452048264,-.2116463454095397, ...
    -.1329394997952951,-.4089732623879643, ...
    -.9116237193661333E-01,0.5001356343245807, ...
    -.2437824086419522,0.7599889189904093E-02, ...
    0.2361825194520526,0.5725635993272842, ...
    -.3368651110208424E-01,-.5388770882252032, ...
    0.5794897706560004,-.3249959253184209, ...
    -.2544938453375776,0.5504594216795844, ...
    -.3602808234304559,-.1901785982491242, ...
    0.4115986775195391,-.1665168003024589E-01, ...
    -.3949469974892933,-.1430620777928657, ...
    0.6580940175195596E-01,0.7725267604090996E-01, ...
    0.2342697395017627,-.2784188228662802, ...
    0.4414908336450658E-01,-.4017554364367290, ...
    -.3092461241493650,0.7110015605860860, ...
    0.9085253735987711,-.4646238165515825, ...
    -.4439015570471948,0.4730296395382988, ...
    -.1825160620441602,-.2905135774941487, ...
    -.6857456848032077E-01,0.2279222388260412, ...
    -.1593476703457152,0.2190140235085516, ...
    0.3481413428683416E-01,-.2538281577953898, ...
    -.4251600332346974E-01,-.4295820758543226E-01, ...
    0.8547421090889233E-01,-.2447322131044543, ...
    0.2917527702125314,-.4702055710805701E-01, ...
    0.2600283704245143,-.1456258542006649, ...
    -.1144025162238410,0.2964453769751457, ...
    -.2809509380001344,-.1549443897500673E-01, ...
    0.7775759193725890,-.3837855053933897, ...
    -.3937904139792007,-.3624391892660122, ...
    0.1092997287033503,0.2531394605626634, ...
    -.2145827819997083E-01,0.4804479220825398, ...
    -.4589896438825594,0.9342132288033096E-01, ...
    0.4359627055553254,-.5293840284356405, ...
    -.2503585120211285,0.5349275917488283, ...
    -.2845690797277077,-.1532525106706588, ...
    0.3497030592011267,-.1964505485304861, ...
    0.1086435405003431D+01,-.5590802894074118, ...
    -.5273551155960269,-.2277988977546228, ...
    -.4663353679452422,0.6941342656998574, ...
    0.2108172081069621,0.1355874975580061, ...
    -.3464047056649888,0.3748559371110348, ...
    -.1030184566954502,-.2718374804155939, ...
    0.9400326158922729,-.4605845857832677, ...
    -.4794480301090108,0.3267824275100505E-01, ...
    -.1247602093042907,0.9208196655328471E-01, ...
    -.4194700484257879,0.6313900388299887, ...
    -.2119199904042083,0.3362799093518891, ...
    0.1247966425982771,-.4610765519501666, ...
    0.7996643270816305,-.4819331969673737, ...
    -.3177311301142533,0.9217567340036824, ...
    -.3621416790150311,-.5596150549886635, ...
    0.8169629451576943,-.5521050136126617, ...
    -.2648579315450346,-.1854220399449956, ...
    0.3141894874618389,-.1287674475168422, ...
    0.6224002317220075,-.4509036594166286, ...
    -.1714965723053837,-.1747363709921250D-14, ...
    -.7841339838758449D-14,-.1038742413216324D-13, ...
    -.6434088705165255D-14,0.8511611593137641D-14 ];
  zs = [ ...
    -.3905577451659811,-.3905577451659810, ...
    -.3905577451659885,-.4194761577597843E-02, ...
    -.4194761577604291E-02,-.4194761577584145E-02, ...
    0.1874027021856000,0.1874027021856146, ...
    0.1874027021856214,-.3071102013390232, ...
    -.3071102013390279,-.3071102013390283, ...
    -.2701961597911837E-01,-.2701961597911512E-01, ...
    -.2701961597910549E-01,-.3650223874563840, ...
    -.3650223874563843,-.3650223874563830, ...
    -.8612392000622994E-01,-.8612392000621880E-01, ...
    -.8612392000621745E-01,0.1070791221730147, ...
    0.1070791221730203,0.1070791221730225, ...
    0.3230374822491166E-01,0.3230374822490626E-01, ...
    0.3230374822491062E-01,0.3289827199375365, ...
    0.3289827199375268,0.3289827199375392, ...
    -.2002324469987915,-.2002324469988037, ...
    -.2002324469988010,-.2771825970811163, ...
    -.2771825970811178,-.2771825970811177, ...
    -.3794145952130761,-.3794145952130777, ...
    -.3794145952130777,0.2887592197883361, ...
    0.2887592197883261,0.2887592197883259, ...
    0.7307953050563157,0.7307953050563196, ...
    0.7307953050563138,0.4124918246328610, ...
    0.4124918246328517,0.4124918246328527, ...
    0.9839020121236216,0.9839020121236166, ...
    0.9839020121236378,0.6829751492607604E-01, ...
    0.6829751492606395E-01,0.6829751492607447E-01, ...
    0.5090267712108498,0.5090267712108671, ...
    0.5090267712108663,0.3851617855258526, ...
    0.3851617855258565,0.3851617855258507, ...
    0.2348420776072121E-01,0.2348420776071207E-01, ...
    0.2348420776071097E-01,0.7747281662419676E-01, ...
    0.7747281662420324E-01,0.7747281662419568E-01, ...
    -.1630338566084656,-.1630338566084718, ...
    -.1630338566084695,-.3584562395667113, ...
    -.3584562395667106,-.3584562395667084, ...
    0.3698626219613211,0.3698626219613297, ...
    0.3698626219613188,-.3667298228875690, ...
    -.3667298228875713,-.3667298228875721, ...
    -.3790081337166384,-.3790081337166408, ...
    -.3790081337166418,-.2197227060814419, ...
    -.2197227060814434,-.2197227060814370, ...
    -.3654645869052863,-.3654645869052863, ...
    -.3654645869052867,-.2014726326233556, ...
    -.2014726326233535,-.2014726326233503, ...
    -.2464405285751480,-.2464405285751552, ...
    -.2464405285751559,0.7375395719855852, ...
    0.7375395719855836,0.7375395719855902, ...
    -.3689240261223760,-.3689240261223751, ...
    -.3689240261223750,-.2202508600260902, ...
    -.2202508600260935,-.2202508600260907, ...
    -.1594720366091775,-.1594720366091723, ...
    -.1594720366091740,-.3758886073617869, ...
    -.3758886073617894,-.3758886073617892, ...
    -.3542700621002714,-.3542700621002700, ...
    -.3542700621002702,0.6895589091912253, ...
    0.6895589091912366,0.6895589091912278, ...
    -.4073916692470354,-.4073916692470370, ...
    -.4073916692470400,0.6482117053575507, ...
    0.1198603539538932D+01,-.4041509145471567, ...
    -.2710584986072719,0.8757555073873696E-02 ];
  ws = [ ...
    0.2025764222341204E-02,0.2025764222341283E-02, ...
    0.2025764222340314E-02,0.6116300216663094E-02, ...
    0.6116300216663310E-02,0.6116300216663541E-02, ...
    0.1275819159212241E-01,0.1275819159212196E-01, ...
    0.1275819159212162E-01,0.8334684897884583E-02, ...
    0.8334684897884422E-02,0.8334684897884272E-02, ...
    0.1507614954107500E-01,0.1507614954107359E-01, ...
    0.1507614954107202E-01,0.2734637742973762E-02, ...
    0.2734637742973644E-02,0.2734637742974016E-02, ...
    0.1154303798541227E-01,0.1154303798541274E-01, ...
    0.1154303798541255E-01,0.7163952410599667E-02, ...
    0.7163952410599083E-02,0.7163952410598778E-02, ...
    0.7580503447649259E-02,0.7580503447650207E-02, ...
    0.7580503447650126E-02,0.1894249152240793E-01, ...
    0.1894249152240805E-01,0.1894249152240727E-01, ...
    0.1641784697591419E-01,0.1641784697591236E-01, ...
    0.1641784697591317E-01,0.8436640400263927E-02, ...
    0.8436640400264633E-02,0.8436640400264418E-02, ...
    0.3036004079076158E-02,0.3036004079076059E-02, ...
    0.3036004079076094E-02,0.7492415688372185E-02, ...
    0.7492415688372261E-02,0.7492415688372197E-02, ...
    0.3062456464426824E-02,0.3062456464427586E-02, ...
    0.3062456464427105E-02,0.8856133214568079E-02, ...
    0.8856133214567973E-02,0.8856133214568157E-02, ...
    0.3071402699546415E-02,0.3071402699546453E-02, ...
    0.3071402699546178E-02,0.1823835135198804E-01, ...
    0.1823835135198757E-01,0.1823835135198796E-01, ...
    0.1121658861163283E-01,0.1121658861163258E-01, ...
    0.1121658861163293E-01,0.5177567930581361E-02, ...
    0.5177567930581481E-02,0.5177567930580846E-02, ...
    0.3242723020974106E-02,0.3242723020974469E-02, ...
    0.3242723020974430E-02,0.1136422978208590E-01, ...
    0.1136422978208548E-01,0.1136422978208555E-01, ...
    0.8174247103577847E-02,0.8174247103578128E-02, ...
    0.8174247103578329E-02,0.4083194002127334E-02, ...
    0.4083194002127503E-02,0.4083194002128160E-02, ...
    0.3128101586450114E-02,0.3128101586450456E-02, ...
    0.3128101586450350E-02,0.1081664090579396E-01, ...
    0.1081664090579364E-01,0.1081664090579339E-01, ...
    0.4910680133298682E-03,0.4910680133297917E-03, ...
    0.4910680133297780E-03,0.8074513061447679E-02, ...
    0.8074513061447566E-02,0.8074513061448123E-02, ...
    0.1112708329974781E-01,0.1112708329974803E-01, ...
    0.1112708329974812E-01,0.2131526487678964E-01, ...
    0.2131526487679003E-01,0.2131526487678986E-01, ...
    0.3571026646377801E-02,0.3571026646377656E-02, ...
    0.3571026646377794E-02,0.7768447076866043E-02, ...
    0.7768447076865915E-02,0.7768447076866019E-02, ...
    0.7618830679555172E-02,0.7618830679555604E-02, ...
    0.7618830679555573E-02,0.1180399216908969E-01, ...
    0.1180399216908947E-01,0.1180399216908933E-01, ...
    0.2753708273597594E-02,0.2753708273597404E-02, ...
    0.2753708273597407E-02,0.1252040626033346E-02, ...
    0.1252040626033167E-02,0.1252040626033129E-02, ...
    0.2035505637330654E-02,0.2035505637330660E-02, ...
    0.2035505637330673E-02,0.2152733016776995E-02, ...
    0.2152733016776493E-02,0.2152733016776350E-02, ...
    0.2538969965943544E-02,0.2538969965943405E-02, ...
    0.2538969965943241E-02,0.1078372873958245E-01, ...
    0.1943908493037603E-03,0.4799528389705479E-02, ...
    0.2477673544485754E-01,0.2864883777302190E-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
