function [ x, w ] = rule06 ( n )

%*****************************************************************************80
%
%% RULE06 returns the rule of degree 6.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 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.6520106181245787E+00, -0.8839112733197223E+00, ...
    -0.4110873304651753E+00, -0.5483810510367449E+00, ...
    0.2892216600948648E+00, 0.6342733723572165E+00, ...
    0.9277349401977213E+00, 0.1959145493384946E+00, ...
    0.9698859394138759E+00, 0.2417507986598153E+00, ...
    0.8736828548839980E+00, -0.2473250700893141E+00, ...
    -0.8359900749051526E+00, -0.7010811197269031E+00, ...
    0.6850729043876912E+00, 0.8706999495161931E+00, ...
    0.4433962826908943E+00, -0.2932096565623538E+00, ...
    -0.2633910887960743E+00, -0.9524343530691857E+00, ...
    0.5584942649156998E+00, -0.9550226927399118E+00 ];
  ys = [ ...
    -0.9205233816190030E+00, 0.6254092057729300E+00, ...
    -0.6525192767687262E+00, 0.6675277466837514E+00, ...
    0.4977300744517685E+00, -0.8473122703810076E+00, ...
    -0.2928745039351578E+00, -0.1497907581315417E+00, ...
    0.3885854764755980E+00, -0.3158285918947235E+00, ...
    0.8526532103620746E+00, 0.4591872919393147E+00, ...
    -0.2440514778109439E+00, 0.4373390182884227E-01, ...
    0.3426959807532622E+00, -0.5660924679198789E+00, ...
    0.9081219217522495E+00, 0.9293150291789362E+00, ...
    -0.7810388725033286E+00, 0.8260274928505457E+00, ...
    -0.9767688598333689E+00, -0.8519217238424458E+00 ];
  zs = [ ...
    -0.9890506976739800E+00, 0.9406229500121331E+00, ...
    0.9356142377961858E+00, -0.9192764154799976E+00, ...
    0.8878969382797651E+00, -0.7870867837034067E+00, ...
    0.8660830979298149E+00, -0.8024709071632448E+00, ...
    -0.8880711289349531E+00, 0.4529703911468836E+00, ...
    0.5290490417189219E+00, -0.1854203758534000E+00, ...
    -0.5963095626351139E+00, 0.4902173455917232E+00, ...
    -0.2880115314573995E-01, -0.2057637646023516E+00, ...
    -0.6042328075390052E+00, 0.4966484117970202E+00, ...
    -0.2095900180453476E+00, -0.2268797125337812E+00, ...
    0.6071604819572268E+00, 0.3850513071757548E+00 ];
  ws = [ ...
    0.3178879561185747E-01, 0.4164076216957761E-01, ...
    0.9948981399775451E-01, 0.9210852733177771E-01, ...
    0.1401943913356885E+00, 0.7264966274445117E-01, ...
    0.6525340756744888E-01, 0.2204173451372487E+00, ...
    0.5094524937590311E-01, 0.2682685881175325E+00, ...
    0.6962627523546265E-01, 0.2686201905068337E+00, ...
    0.1619957777392285E+00, 0.2267482460842759E+00, ...
    0.2223611442058410E+00, 0.1285943421530201E+00, ...
    0.1171163684835690E+00, 0.1148693655898215E+00, ...
    0.2337745730572889E+00, 0.6561672504107097E-01, ...
    0.7668684384852936E-01, 0.5966072941200686E-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
