function [ x, w ] = rule08 ( n )

%*****************************************************************************80
%
%% rule08() returns the rule of degree 8.
%
%  Licensing:
%
%    This code is distributed under the MIT 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.
%
%  Input:
%
%    integer N, the number of nodes.
%
%  Output:
%
%    real X(3,N), the coordinates of the nodes.
%
%    real W(N), the weights.
%
  xs = [ ...
    -0.4475988003404910E+00, 0.1190967237337572E+00, ...
    -0.4490161785347289E+00, 0.8651765155230445E+00, ...
    0.6505429233922998E+00, 0.2589210616796688E+00, ...
    0.9656989388220407E+00, 0.2260702905987988E+00, ...
    -0.9447161047888400E+00, -0.3175860090502710E+00, ...
    -0.5229105079658517E+00, 0.7843159489865733E+00, ...
    -0.8185789055564340E+00, 0.2825863387132066E+00, ...
    -0.7607858417694694E+00, 0.5866226772335372E+00, ...
    0.9548626078195578E+00, -0.8132498468766962E+00, ...
    -0.1585020553751056E+00, 0.4773375480094558E+00, ...
    0.1284049655553692E+00, 0.1291886447672361E+00, ...
    -0.5532190735732102E+00, -0.3228367990078276E+00, ...
    0.6814247401185878E+00, 0.7557777797079770E+00, ...
    -0.9000019573243127E+00, -0.2575843081671350E+00, ...
    0.9631832063187018E+00, 0.6908303030190355E+00, ...
    0.1821056025197366E+00, -0.8221919687508521E+00, ...
    0.8588518473343788E+00, -0.8972339906902843E+00, ...
    -0.5358934078144110E+00, -0.5529992683228151E+00, ...
    -0.2001426466255732E-02, 0.9378537204512910E+00, ...
    -0.9715016981164607E+00, -0.9829083600782837E+00, ...
    0.9958977682871862E+00, 0.5952915553901705E+00 ];
  ys = [ ...
    -0.4685908229573946E+00, -0.1796519363018103E+00, ...
    0.8874428218089706E+00, 0.7669380410790798E+00, ...
    -0.3322370805619765E+00, 0.4117713778755101E+00, ...
    0.2677042158057942E+00, -0.6809206038797824E+00, ...
    0.3428366182117646E+00, 0.9241061411826208E+00, ...
    -0.9900623346092050E+00, -0.8016110436407171E+00, ...
    0.4049960292973258E+00, 0.7556974668347299E+00, ...
    -0.4707571060333716E+00, 0.1360876107297970E+00, ...
    -0.9570347291094887E+00, -0.9999285474000510E+00, ...
    -0.8417098248767442E+00, 0.7312551571808507E+00, ...
    -0.8410385448275977E+00, 0.4262088590943245E+00, ...
    -0.2958999490543837E+00, 0.3165179774473898E+00, ...
    0.9500245471112998E+00, -0.6655395544878605E+00, ...
    -0.5042046483103894E+00, -0.4401404838267679E-01, ...
    0.1346519238430116E+00, -0.8848406668667183E-01, ...
    -0.4368801480983787E+00, 0.8270836779598612E+00, ...
    0.6421742345932883E+00, 0.1349979722216108E+00, ...
    0.6936454950162161E+00, -0.8510571525270378E+00, ...
    0.9631601523763739E+00, 0.9984857323994113E+00, ...
    -0.8588323161863770E+00, 0.9585966990212117E+00, ...
    -0.5890142881200693E+00, -0.9993743349557130E+00 ];
  zs = [ ...
    -0.9772314603244738E+00, 0.9815070306506343E+00, ...
    0.9720526068033335E+00, -0.9045817066028675E+00, ...
    -0.9182437310533620E+00, -0.8841947772730918E+00, ...
    0.9557023227491765E+00, 0.7227916414981562E+00, ...
    0.8941205664955980E+00, -0.8999986131977584E+00, ...
    0.9755454910061744E+00, 0.8657944704400204E+00, ...
    -0.8703196425126886E+00, -0.5456656708443869E+00, ...
    0.8251281474414323E+00, -0.3076953975629710E+00, ...
    -0.8869272628530901E+00, -0.9230410589688908E+00, ...
    0.5313897417255299E+00, 0.8095112746222346E+00, ...
    -0.7431662230334861E+00, 0.1742031738076680E+00, ...
    0.2874814736221014E+00, 0.6894604248684468E+00, ...
    -0.4353446530984859E+00, -0.4153364490406374E+00, ...
    -0.6226993610484064E+00, -0.5868262229626008E+00, ...
    -0.6014685458288908E+00, 0.5571508078000768E+00, ...
    -0.2048268508291324E-01, 0.4917939745803034E+00, ...
    0.1369232794659417E+00, 0.7756109558580779E-02, ...
    -0.2857541181158879E+00, -0.2330139351444999E+00, ...
    0.2669563650277833E+00, 0.6741006875162401E+00, ...
    0.4066025204718843E+00, -0.5565937248525152E+00, ...
    0.2510714338774305E+00, 0.1349294493439425E+00 ];
  ws = [ ...
    0.4086705877945525E-01, 0.5411955154283058E-01, ...
    0.2383675183022706E-01, 0.2393935244990715E-01, ...
    0.5813502964307203E-01, 0.7437498461386277E-01, ...
    0.1984960102939174E-01, 0.6544081092072129E-01, ...
    0.2659353157651851E-01, 0.3231832797003169E-01, ...
    0.1304035568169426E-01, 0.3740726636480241E-01, ...
    0.5743227080083509E-01, 0.7044771222211986E-01, ...
    0.6713400141335041E-01, 0.1088370624350729E+00, ...
    0.9430601398037914E-02, 0.9861052589481853E-02, ...
    0.7173538891438543E-01, 0.8420277392308859E-01, ...
    0.8298939034694322E-01, 0.1440733281281141E+00, ...
    0.1295131217734937E+00, 0.1455803502566465E+00, ...
    0.3601936507491939E-01, 0.8420800025743772E-01, ...
    0.6488371524277974E-01, 0.1744028592454575E+00, ...
    0.4595502978127373E-01, 0.1382478089544316E+00, ...
    0.1725289949653584E+00, 0.6019513413223115E-01, ...
    0.8271749698617868E-01, 0.9333260474256072E-01, ...
    0.1346393673413504E+00, 0.9612888710317599E-01, ...
    0.6100738206538034E-01, 0.1085509425473334E-01, ...
    0.2871508442754113E-01, 0.1504859125563503E-01, ...
    0.3740891876232848E-01, 0.4097311354933509E-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
