function [ x, w ] = rule06 ( n )

%*****************************************************************************80
%
%% RULE06 returns the rule of degree 6.
%
%  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.4919941951523113E-02,0.3415058060219544E-01, ...
    -.4561198328617235,0.2144499229769493, ...
    -.1540693059995943,0.3064525403222947, ...
    -.1305882959514773E-01,0.1535244689838072E-01, ...
    -.1567784487775340,-.3973616940506757, ...
    0.9764884616649552E-02,-.5228087984647453, ...
    0.5565605702210328,0.8423081979023464E-01, ...
    0.2174166091160236,0.3212158945225647, ...
    -.2593648078545398,0.5636454767202584, ...
    -.6410949644625729,-.3344151090582155, ...
    -.1894588386892019E-01,-.8214655896199351, ...
    0.8597415475615655 ];
  ys = [ ...
    -.1392238503430922E-01,0.2542073830543402, ...
    -.3110385447445375,-.1234903873249722, ...
    -.6865214472302168E-01,0.1818495501923178, ...
    -.2488891169073396E-01,-.3261143100532925, ...
    0.2522454301000923,-.1977159083378496, ...
    0.6504184291133676,-.6635055304123420E-01, ...
    -.3186690054220115,0.2138059822864521E-01, ...
    0.4599507004997997,-.4260052421545051, ...
    0.3851980211137577,-.1111606227821696, ...
    -.1934318338507612,-.4491758699723651, ...
    0.9010599459930961,-.5109860359355179, ...
    -.5208085141225744 ];
  zs = [ ...
    0.1066228263967720D+01,0.6315886967039234, ...
    0.2300267655106985,0.5632351636302827, ...
    0.6206264896282621,0.1254685876442911, ...
    -.3357705926282663,0.1147788985927003, ...
    0.2140597800705522,-.7963361802882329E-01, ...
    0.5868446281578688E-02,0.1934272688455952E-02, ...
    0.1379740251424839E-01,0.3195756126912550E-01, ...
    -.3027232303753162,-.2994855602604263, ...
    -.2825197099253122,-.3068140495300409, ...
    -.3660473605161587,-.3102423292746128, ...
    -.3473952050436902,-.2635645240101362, ...
    -.3603432585369335 ];
  ws = [ ...
    0.6889900028407776E-02,0.3059511845881479E-01, ...
    0.2352818079375775E-01,0.4747145913756433E-01, ...
    0.5149448476741100E-01,0.4198464552012798E-01, ...
    0.6518777271610311E-01,0.5808554412413398E-01, ...
    0.6079762507769643E-01,0.6246727661754427E-01, ...
    0.4232555916776466E-01,0.2191089157324707E-01, ...
    0.4526058614388953E-01,0.1093321687620292, ...
    0.5237000773398501E-01,0.4832452079715138E-01, ...
    0.6123639953387314E-01,0.4577996169297793E-01, ...
    0.2476427914920903E-01,0.3856173525882120E-01, ...
    0.1546337820963114E-01,0.1012088745519476E-01, ...
    0.7031160695311595E-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
