function [ x, w ] = rule12 ( n )

%*****************************************************************************80
%
%% rule12() returns the rule of degree 12.
%
%  Licensing:
%
%    This code is distributed under the MIT 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.
%
%  Input:
%
%    integer N, the number of nodes.
%
%  Output:
%
%    real X(3,N), the coordinates of the nodes.
%
%    real W(N), the weights.
%
  xs = [ ...
    0.3958544098912666,-0.4870511331351648, ...
    0.9119672324389515E-01,-0.5926431804946591, ...
    0.5193516147881150,0.7329156570653904E-01, ...
    -0.4544141850245140E-01,-0.2756993864806933, ...
    0.3211408049831440,-0.3413860630862161, ...
    0.5248742662396945,-0.1834882031534880, ...
    -0.1319722431139201,0.2771078804366659, ...
    -0.1451356373227354,0.2916719156941026, ...
    -0.6416905801467393,0.3500186644526196, ...
    -0.4070439485536645E-01,-0.4815006651936328, ...
    0.5222050600490048,-0.9820856549819251E-01, ...
    -0.4276075601779065,0.5258161256761047, ...
    0.2184089033681613,-0.4656593625800790, ...
    0.2472504592119225,-0.6606777491144762E-02, ...
    0.1271987824323769,-0.1205920049412379, ...
    -0.1862346674942773,-0.1097662119993451, ...
    0.2960008794936306,-0.5890402754221185, ...
    0.6424505517737594,-0.5341027635165645E-01, ...
    -0.1196400210307819E-01,-0.7808240524677493, ...
    0.7927880545708264,0.6235239461686299E-01, ...
    -0.4408318818916021,0.3784794872747496, ...
    0.2235903863093564,-0.5240787479715297E-01, ...
    -0.1711825115122079,0.1666477050331823, ...
    -0.2729955606600447,0.1063478556268736, ...
    -0.7415049139037595E-01,0.7389518464069887E-01, ...
    0.2553067496801190E-03,0.1955908717228039, ...
    0.1141488778114551,-0.3097397495342445, ...
    -0.1802680258591541E-01,-0.2161777731993448, ...
    0.2342045757852541,-0.1532613811702923, ...
    -0.1800985367097719,0.3333599178800782, ...
    0.5776336665233524E-02,-0.6762886678803212, ...
    0.6705123312150877,-0.8304590790913337E-01, ...
    0.3554044991859694,-0.2723585912768360, ...
    0.5423845315967933,-0.2526088517557438, ...
    -0.2897756798410528,0.5573431967310101, ...
    -0.3595768372350124,-0.1977663594959926, ...
    0.4731366238769863,-0.1975148047452081E-01, ...
    -0.4533851434024622,0.3153219324427421, ...
    -0.2494039878683618E-01,-0.2903815336558955, ...
    -0.1831653764008917E-01,-0.9317223914837645, ...
    0.9500389291238570,-0.6699974553713883, ...
    0.5322783600952914,0.1377190952760970, ...
    0.2782783282780965,-0.3217122219145910, ...
    0.4343389363650290E-01,0.9746770878915403E-01, ...
    -0.3733686186921615,0.2759009099030095, ...
    0.1089081465931238E-01,-0.8195375330783097, ...
    0.8086467184189974,-0.1251938886030335, ...
    0.3429675592810749E-01,0.9089713267491691E-01, ...
    0.4868852723886817,0.1198290818690802, ...
    -0.6067143542577578,0.3382540465835279, ...
    -0.4603539675728300,0.1220999209893009, ...
    -0.9480210749913888E-01,-0.6451285680033118, ...
    0.7399306755024498,0.1140113067761596, ...
    -0.8552704011446526,0.7412590943684850, ...
    -0.1658421801556803,-0.6245895743792733, ...
    0.7904317545349575,0.2557413056493574, ...
    0.3270954418922731E-01,-0.2884508498385872, ...
    -0.1613157569571640,-0.4583565335140027, ...
    0.6196722904711670,0.2156998987651826E-14, ...
    0.2157685773910294E-14,0.9329761593328095E-14, ...
    -0.1937826095544789E-14,0.5112100598082816E-14 ];
  ys = [ ...
    0.3338515555387722,0.1758941973965540, ...
    -0.5097457529353365,-0.2575328894119814, ...
    -0.3844776049819921,0.6420104943939733, ...
    0.3445858452048264,-0.2116463454095397, ...
    -0.1329394997952951,-0.4089732623879643, ...
    -0.9116237193661333E-01,0.5001356343245807, ...
    -0.2437824086419522,0.7599889189904093E-02, ...
    0.2361825194520526,0.5725635993272842, ...
    -0.3368651110208424E-01,-0.5388770882252032, ...
    0.5794897706560004,-0.3249959253184209, ...
    -0.2544938453375776,0.5504594216795844, ...
    -0.3602808234304559,-0.1901785982491242, ...
    0.4115986775195391,-0.1665168003024589E-01, ...
    -0.3949469974892933,-0.1430620777928657, ...
    0.6580940175195596E-01,0.7725267604090996E-01, ...
    0.2342697395017627,-0.2784188228662802, ...
    0.4414908336450658E-01,-0.4017554364367290, ...
    -0.3092461241493650,0.7110015605860860, ...
    0.9085253735987711,-0.4646238165515825, ...
    -0.4439015570471948,0.4730296395382988, ...
    -0.1825160620441602,-0.2905135774941487, ...
    -0.6857456848032077E-01,0.2279222388260412, ...
    -0.1593476703457152,0.2190140235085516, ...
    0.3481413428683416E-01,-0.2538281577953898, ...
    -0.4251600332346974E-01,-0.4295820758543226E-01, ...
    0.8547421090889233E-01,-0.2447322131044543, ...
    0.2917527702125314,-0.4702055710805701E-01, ...
    0.2600283704245143,-0.1456258542006649, ...
    -0.1144025162238410,0.2964453769751457, ...
    -0.2809509380001344,-0.1549443897500673E-01, ...
    0.7775759193725890,-0.3837855053933897, ...
    -0.3937904139792007,-0.3624391892660122, ...
    0.1092997287033503,0.2531394605626634, ...
    -0.2145827819997083E-01,0.4804479220825398, ...
    -0.4589896438825594,0.9342132288033096E-01, ...
    0.4359627055553254,-0.5293840284356405, ...
    -0.2503585120211285,0.5349275917488283, ...
    -0.2845690797277077,-0.1532525106706588, ...
    0.3497030592011267,-0.1964505485304861, ...
    0.1086435405003431E+01,-0.5590802894074118, ...
    -0.5273551155960269,-0.2277988977546228, ...
    -0.4663353679452422,0.6941342656998574, ...
    0.2108172081069621,0.1355874975580061, ...
    -0.3464047056649888,0.3748559371110348, ...
    -0.1030184566954502,-0.2718374804155939, ...
    0.9400326158922729,-0.4605845857832677, ...
    -0.4794480301090108,0.3267824275100505E-01, ...
    -0.1247602093042907,0.9208196655328471E-01, ...
    -0.4194700484257879,0.6313900388299887, ...
    -0.2119199904042083,0.3362799093518891, ...
    0.1247966425982771,-0.4610765519501666, ...
    0.7996643270816305,-0.4819331969673737, ...
    -0.3177311301142533,0.9217567340036824, ...
    -0.3621416790150311,-0.5596150549886635, ...
    0.8169629451576943,-0.5521050136126617, ...
    -0.2648579315450346,-0.1854220399449956, ...
    0.3141894874618389,-0.1287674475168422, ...
    0.6224002317220075,-0.4509036594166286, ...
    -0.1714965723053837,-0.1747363709921250E-14, ...
    -0.7841339838758449E-14,-0.1038742413216324E-13, ...
    -0.6434088705165255E-14,0.8511611593137641E-14 ];
  zs = [ ...
    -0.3905577451659811,-0.3905577451659810, ...
    -0.3905577451659885,-0.4194761577597843E-02, ...
    -0.4194761577604291E-02,-0.4194761577584145E-02, ...
    0.1874027021856000,0.1874027021856146, ...
    0.1874027021856214,-0.3071102013390232, ...
    -0.3071102013390279,-0.3071102013390283, ...
    -0.2701961597911837E-01,-0.2701961597911512E-01, ...
    -0.2701961597910549E-01,-0.3650223874563840, ...
    -0.3650223874563843,-0.3650223874563830, ...
    -0.8612392000622994E-01,-0.8612392000621880E-01, ...
    -0.8612392000621745E-01,0.1070791221730147, ...
    0.1070791221730203,0.1070791221730225, ...
    0.3230374822491166E-01,0.3230374822490626E-01, ...
    0.3230374822491062E-01,0.3289827199375365, ...
    0.3289827199375268,0.3289827199375392, ...
    -0.2002324469987915,-0.2002324469988037, ...
    -0.2002324469988010,-0.2771825970811163, ...
    -0.2771825970811178,-0.2771825970811177, ...
    -0.3794145952130761,-0.3794145952130777, ...
    -0.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, ...
    -0.1630338566084656,-0.1630338566084718, ...
    -0.1630338566084695,-0.3584562395667113, ...
    -0.3584562395667106,-0.3584562395667084, ...
    0.3698626219613211,0.3698626219613297, ...
    0.3698626219613188,-0.3667298228875690, ...
    -0.3667298228875713,-0.3667298228875721, ...
    -0.3790081337166384,-0.3790081337166408, ...
    -0.3790081337166418,-0.2197227060814419, ...
    -0.2197227060814434,-0.2197227060814370, ...
    -0.3654645869052863,-0.3654645869052863, ...
    -0.3654645869052867,-0.2014726326233556, ...
    -0.2014726326233535,-0.2014726326233503, ...
    -0.2464405285751480,-0.2464405285751552, ...
    -0.2464405285751559,0.7375395719855852, ...
    0.7375395719855836,0.7375395719855902, ...
    -0.3689240261223760,-0.3689240261223751, ...
    -0.3689240261223750,-0.2202508600260902, ...
    -0.2202508600260935,-0.2202508600260907, ...
    -0.1594720366091775,-0.1594720366091723, ...
    -0.1594720366091740,-0.3758886073617869, ...
    -0.3758886073617894,-0.3758886073617892, ...
    -0.3542700621002714,-0.3542700621002700, ...
    -0.3542700621002702,0.6895589091912253, ...
    0.6895589091912366,0.6895589091912278, ...
    -0.4073916692470354,-0.4073916692470370, ...
    -0.4073916692470400,0.6482117053575507, ...
    0.1198603539538932E+01,-0.4041509145471567, ...
    -0.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
