function [ x, w ] = rule20 ( n )

%*****************************************************************************80
%
%% RULE20 returns the rule of degree 20.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    01 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(2,N), the coordinates of the nodes.
%
%    Output, real W(N), the weights.
%
  xs = [ ...
   -0.9795110740034025E+00, ...
    0.9831906073122737E+00, ...
    0.9795110740034028E+00, ...
   -0.9831906073122735E+00, ...
   -0.7431761069248197E+00, ...
    0.9923743096061538E+00, ...
    0.7431761069248199E+00, ...
   -0.9923743096061538E+00, ...
   -0.4283144128355606E+00, ...
    0.9641460474769801E+00, ...
    0.4283144128355607E+00, ...
   -0.9641460474769801E+00, ...
    0.2195391124808899E+00, ...
    0.9631697483532271E+00, ...
   -0.2195391124808898E+00, ...
   -0.9631697483532271E+00, ...
    0.6056140907858303E+00, ...
    0.9331619907848750E+00, ...
   -0.6056140907858301E+00, ...
   -0.9331619907848750E+00, ...
    0.4538625783394974E+00, ...
    0.9980174969022684E+00, ...
   -0.4538625783394973E+00, ...
   -0.9980174969022684E+00, ...
   -0.8095537467004988E+00, ...
    0.7623591488515665E+00, ...
    0.8095537467004988E+00, ...
   -0.7623591488515665E+00, ...
   -0.1187579119827596E+00, ...
    0.9879801664420653E+00, ...
    0.1187579119827597E+00, ...
   -0.9879801664420653E+00, ...
   -0.8923235157505165E+00, ...
    0.9333621871500086E+00, ...
    0.8923235157505167E+00, ...
   -0.9333621871500086E+00, ...
    0.8231553038658227E+00, ...
    0.9792360167943942E+00, ...
   -0.8231553038658225E+00, ...
   -0.9792360167943942E+00, ...
   -0.2288711050959638E+00, ...
    0.8448136056975591E+00, ...
    0.2288711050959640E+00, ...
   -0.8448136056975591E+00, ...
   -0.6414644180013116E+00, ...
    0.8887383480333905E+00, ...
    0.6414644180013116E+00, ...
   -0.8887383480333905E+00, ...
    0.2100118285690190E-01, ...
    0.9154636292013463E+00, ...
   -0.2100118285690179E-01, ...
   -0.9154636292013463E+00, ...
    0.2939039049089534E+00, ...
    0.4700673563865673E+00, ...
   -0.2939039049089532E+00, ...
   -0.4700673563865673E+00, ...
   -0.4701209495753256E+00, ...
    0.7110849452816542E+00, ...
    0.4701209495753257E+00, ...
   -0.7110849452816542E+00, ...
   -0.2561845423520469E+00, ...
    0.1372468757285573E-01, ...
    0.2561845423520469E+00, ...
   -0.1372468757285570E-01, ...
    0.5331634078426070E+00, ...
    0.6746722584255035E+00, ...
   -0.5331634078426070E+00, ...
   -0.6746722584255035E+00, ...
    0.3458330575650539E+00, ...
    0.8408056203362516E+00, ...
   -0.3458330575650538E+00, ...
   -0.8408056203362516E+00, ...
    0.6630732857737233E-01, ...
    0.6973527543224615E+00, ...
   -0.6630732857737225E-01, ...
   -0.6973527543224615E+00, ...
   -0.2157929992274237E+00, ...
    0.5168584327986239E+00, ...
    0.2157929992274237E+00, ...
   -0.5168584327986239E+00, ...
   -0.1195405968452537E-31 ];
  ys = [ ...
   -0.9831906073122738E+00, ...
   -0.9795110740034026E+00, ...
    0.9831906073122736E+00, ...
    0.9795110740034029E+00, ...
   -0.9923743096061538E+00, ...
   -0.7431761069248198E+00, ...
    0.9923743096061538E+00, ...
    0.7431761069248201E+00, ...
   -0.9641460474769801E+00, ...
   -0.4283144128355607E+00, ...
    0.9641460474769801E+00, ...
    0.4283144128355608E+00, ...
   -0.9631697483532271E+00, ...
    0.2195391124808899E+00, ...
    0.9631697483532271E+00, ...
   -0.2195391124808898E+00, ...
   -0.9331619907848750E+00, ...
    0.6056140907858302E+00, ...
    0.9331619907848750E+00, ...
   -0.6056140907858300E+00, ...
   -0.9980174969022684E+00, ...
    0.4538625783394974E+00, ...
    0.9980174969022684E+00, ...
   -0.4538625783394973E+00, ...
   -0.7623591488515665E+00, ...
   -0.8095537467004988E+00, ...
    0.7623591488515665E+00, ...
    0.8095537467004988E+00, ...
   -0.9879801664420653E+00, ...
   -0.1187579119827596E+00, ...
    0.9879801664420653E+00, ...
    0.1187579119827597E+00, ...
   -0.9333621871500086E+00, ...
   -0.8923235157505166E+00, ...
    0.9333621871500086E+00, ...
    0.8923235157505168E+00, ...
   -0.9792360167943942E+00, ...
    0.8231553038658226E+00, ...
    0.9792360167943942E+00, ...
   -0.8231553038658224E+00, ...
   -0.8448136056975591E+00, ...
   -0.2288711050959639E+00, ...
    0.8448136056975591E+00, ...
    0.2288711050959640E+00, ...
   -0.8887383480333905E+00, ...
   -0.6414644180013116E+00, ...
    0.8887383480333905E+00, ...
    0.6414644180013116E+00, ...
   -0.9154636292013463E+00, ...
    0.2100118285690184E-01, ...
    0.9154636292013463E+00, ...
   -0.2100118285690173E-01, ...
   -0.4700673563865673E+00, ...
    0.2939039049089533E+00, ...
    0.4700673563865673E+00, ...
   -0.2939039049089532E+00, ...
   -0.7110849452816542E+00, ...
   -0.4701209495753256E+00, ...
    0.7110849452816542E+00, ...
    0.4701209495753257E+00, ...
   -0.1372468757285574E-01, ...
   -0.2561845423520469E+00, ...
    0.1372468757285571E-01, ...
    0.2561845423520469E+00, ...
   -0.6746722584255035E+00, ...
    0.5331634078426070E+00, ...
    0.6746722584255035E+00, ...
   -0.5331634078426070E+00, ...
   -0.8408056203362516E+00, ...
    0.3458330575650538E+00, ...
    0.8408056203362516E+00, ...
   -0.3458330575650537E+00, ...
   -0.6973527543224615E+00, ...
    0.6630732857737229E-01, ...
    0.6973527543224615E+00, ...
   -0.6630732857737220E-01, ...
   -0.5168584327986239E+00, ...
   -0.2157929992274237E+00, ...
    0.5168584327986239E+00, ...
    0.2157929992274238E+00, ...
    0.3240416764471269E-32 ];
  ws = [ ...
    0.2403280128020245E-02, ...
    0.2403280128020245E-02, ...
    0.2403280128020245E-02, ...
    0.2403280128020245E-02, ...
    0.6918304937846545E-02, ...
    0.6918304937846545E-02, ...
    0.6918304937846545E-02, ...
    0.6918304937846545E-02, ...
    0.1998132824455828E-01, ...
    0.1998132824455828E-01, ...
    0.1998132824455828E-01, ...
    0.1998132824455828E-01, ...
    0.1612406542082527E-01, ...
    0.1612406542082527E-01, ...
    0.1612406542082527E-01, ...
    0.1612406542082527E-01, ...
    0.2451719014395468E-01, ...
    0.2451719014395468E-01, ...
    0.2451719014395468E-01, ...
    0.2451719014395468E-01, ...
    0.5618083393401648E-02, ...
    0.5618083393401648E-02, ...
    0.5618083393401648E-02, ...
    0.5618083393401648E-02, ...
    0.3267989661107104E-01, ...
    0.3267989661107104E-01, ...
    0.3267989661107104E-01, ...
    0.3267989661107104E-01, ...
    0.9643554633385169E-02, ...
    0.9643554633385169E-02, ...
    0.9643554633385169E-02, ...
    0.9643554633385169E-02, ...
    0.1438022637487432E-01, ...
    0.1438022637487432E-01, ...
    0.1438022637487432E-01, ...
    0.1438022637487432E-01, ...
    0.9462403050575163E-02, ...
    0.9462403050575163E-02, ...
    0.9462403050575163E-02, ...
    0.9462403050575163E-02, ...
    0.4414700234043260E-01, ...
    0.4414700234043260E-01, ...
    0.4414700234043260E-01, ...
    0.4414700234043260E-01, ...
    0.2997776103642255E-01, ...
    0.2997776103642255E-01, ...
    0.2997776103642255E-01, ...
    0.2997776103642255E-01, ...
    0.2217921802120890E-01, ...
    0.2217921802120890E-01, ...
    0.2217921802120890E-01, ...
    0.2217921802120890E-01, ...
    0.7979169324002153E-01, ...
    0.7979169324002153E-01, ...
    0.7979169324002153E-01, ...
    0.7979169324002153E-01, ...
    0.5450753416951606E-01, ...
    0.5450753416951606E-01, ...
    0.5450753416951606E-01, ...
    0.5450753416951606E-01, ...
    0.9164051342923195E-01, ...
    0.9164051342923195E-01, ...
    0.9164051342923195E-01, ...
    0.9164051342923195E-01, ...
    0.5417703706712328E-01, ...
    0.5417703706712328E-01, ...
    0.5417703706712328E-01, ...
    0.5417703706712328E-01, ...
    0.4265496337854927E-01, ...
    0.4265496337854927E-01, ...
    0.4265496337854927E-01, ...
    0.4265496337854927E-01, ...
    0.6713307669025259E-01, ...
    0.6713307669025259E-01, ...
    0.6713307669025259E-01, ...
    0.6713307669025259E-01, ...
    0.7903551107191877E-01, ...
    0.7903551107191877E-01, ...
    0.7903551107191877E-01, ...
    0.7903551107191877E-01, ...
    0.5365512134302086E-03 ];

  x(1,1:n) = xs(1:n);
  x(2,1:n) = ys(1:n);
  w(1:n) = ws(1:n);

  return
end
