function [ x, w ] = rule08 ( n )

%*****************************************************************************80
%
%% rule08() returns the rule of degree 8.
%
%  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.1611772551670525E-01,-0.7148827236840712E-02, ...
    0.4589923372088558,-0.4520990492494178, ...
    0.1109560356430631,0.1825224293648890, ...
    -0.1507489805419971,-0.2877324734878600, ...
    0.3680747212378487,0.4788156424890513, ...
    -0.3478779367400819,-0.3548285868734744E-01, ...
    0.2591650442934043,-0.1305037378946309E-02, ...
    -0.3493996070828597E-01,-0.1660462859707297, ...
    0.1010085522422429,-0.3587468163605144, ...
    -0.3473067563985682,-0.8635741121401184E-01, ...
    0.2901168201778487,0.1042093355150105, ...
    -0.6419387451918364E-01,-0.2016986972118968, ...
    0.1846170677356399,0.3788893958160157, ...
    -0.4818716163165796,0.6821719050778170, ...
    0.3978642293015137,-0.6975889470159129, ...
    0.2742964749336314E-02,0.1645687860050991E-01, ...
    -0.4618349214785903,0.1575090568397094, ...
    0.5399175203215238,-0.1403905262089725, ...
    0.4453396570037857E-01,-0.4234360302104348, ...
    -0.7214176376894034,0.7278118716190342, ...
    0.4901890779701343,-0.8758887352507779, ...
    0.7632377205619759E-02,0.9317431147169187 ];
  ys = [ ...
    0.7998600119500696E-03,0.1723914595007140, ...
    -0.1744716351651229,-0.2632941629071404, ...
    -0.6295720376005641E-01,0.1678382818593359, ...
    -0.7826941873249307E-01,-0.1234686974783635, ...
    -0.2169876766339741,-0.4629437300594242E-01, ...
    -0.1295630336164733,-0.2268108031307481, ...
    0.1330071443027294,0.4919409115894537, ...
    0.3001995169122194,0.1407736457687509, ...
    -0.2259257575315161,-0.1083199795573463, ...
    -0.3742304739030127,-0.1478062482085008, ...
    -0.3449512373726749,0.2883671141680468E-01, ...
    0.2558125570853043,0.4404368079041183, ...
    0.3998568605285963,-0.9956585162815586E-01, ...
    -0.1509747383909747E-01,-0.3956518618817587, ...
    0.2256616013248351,-0.3899651023918449, ...
    0.8134998230879619,-0.4451036700294634, ...
    -0.4535647479937944,0.6650145460171435, ...
    -0.4674624469973033,0.7012653983759632, ...
    -0.5107241847309127,0.2263324997687613, ...
    -0.2727155170636352,-0.2861627803070728, ...
    0.1856306523332632,-0.5566374678887420, ...
    0.1056056946669113E+01,-0.5664247124705913 ];
  zs = [ ...
    0.1140750120480647E+01,0.7860696072793454, ...
    -0.3991430912330994,0.3536092960240441, ...
    0.8189404142301465,0.4764962716361752, ...
    0.7628974295081231,-0.3880058323817796, ...
    0.3997553695274408,0.1144656464995089, ...
    0.2509171968778639,0.4174615578343315, ...
    -0.2747778345118032,0.3031929324753210, ...
    -0.3442503524230918,0.3970537434180833, ...
    -0.3070893258601431,-0.1989904396903917, ...
    0.1526258958568332E-01,-0.1542350189843949E-03, ...
    0.4121026001314489E-01,0.3248913848279931, ...
    -0.6957900515388780E-01,-0.3340987564879216E-01, ...
    -0.1303527431545757E-01,-0.8390322512212595E-01, ...
    -0.4501404031339341E-01,-0.7451523522744341E-01, ...
    -0.3993939022009145,-0.1254210458205579, ...
    -0.1415815795205319,-0.1858244299410800, ...
    -0.3245512424809017,-0.3317121001508232, ...
    -0.3168159505701121,-0.3372150239150091, ...
    -0.3950013670511707,-0.3336444006035868, ...
    -0.3519392970001664,-0.3226167582915808, ...
    -0.2780042325707565,-0.3720577799104590, ...
    -0.3972751008974220,-0.3821073616790632 ];
  ws = [ ...
    0.1694544493019982E-02,0.1462667227182682E-01, ...
    0.9589935274093377E-02,0.9835015847019813E-02, ...
    0.1710148279355958E-01,0.1516325692442914E-01, ...
    0.1746691605511999E-01,0.1604974314640067E-01, ...
    0.2185156320663785E-01,0.1242799062066869E-01, ...
    0.2646409426919389E-01,0.3135597218974045E-01, ...
    0.2736783716876112E-01,0.2345735439005822E-01, ...
    0.3130572641601596E-01,0.3548953658742431E-01, ...
    0.4036134913447077E-01,0.3792924852161072E-01, ...
    0.2440963887102594E-01,0.5132903383025206E-01, ...
    0.3177764520649842E-01,0.5417358749775593E-01, ...
    0.5180566415546370E-01,0.2633068360731991E-01, ...
    0.3893527990282211E-01,0.5027716272897634E-01, ...
    0.2208377845212325E-01,0.1429278762793107E-01, ...
    0.6697289387082959E-02,0.1648266825522313E-01, ...
    0.1688462952130244E-01,0.2190464958161271E-01, ...
    0.2281706804403004E-01,0.1956212468616595E-01, ...
    0.1994889218942623E-01,0.1737944394368884E-01, ...
    0.7302913219204132E-02,0.2128832734454982E-01, ...
    0.1333720911018169E-01,0.1494192725418561E-01, ...
    0.1152112823254964E-01,0.2472998490996246E-02, ...
    0.2018756899942699E-02,0.1470016064285112E-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
