function [ x, w ] = rule16 ( n )

%*****************************************************************************80
%
%% RULE16 returns the rule of degree 16.
%
%  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.7331873192446229E+00, ...
   -0.7331873192446227E+00, ...
   -0.9811278880414770E+00, ...
    0.9811278880414772E+00, ...
   -0.8004995596996590E+00, ...
    0.8004995596996592E+00, ...
    0.2935594202060772E+00, ...
   -0.2935594202060772E+00, ...
    0.5019013651861420E+00, ...
   -0.5019013651861418E+00, ...
   -0.9240427888147712E+00, ...
    0.9240427888147712E+00, ...
   -0.7321159842417640E+00, ...
    0.7321159842417640E+00, ...
    0.9107218705094187E+00, ...
   -0.9107218705094184E+00, ...
    0.9799531606782582E+00, ...
   -0.9799531606782582E+00, ...
   -0.2536359436096021E+00, ...
    0.2536359436096021E+00, ...
    0.8800049697526030E+00, ...
   -0.8800049697526030E+00, ...
    0.7136219272623606E+00, ...
   -0.7136219272623606E+00, ...
    0.5185051092186185E+00, ...
   -0.5185051092186185E+00, ...
    0.9890262305049052E+00, ...
   -0.9890262305049052E+00, ...
    0.9865971248382277E+00, ...
   -0.9865971248382277E+00, ...
    0.4087785918187709E-01, ...
   -0.4087785918187702E-01, ...
    0.9650604144351506E+00, ...
   -0.9650604144351506E+00, ...
   -0.5228670170578392E+00, ...
    0.5228670170578394E+00, ...
   -0.2304316370092423E+00, ...
    0.2304316370092424E+00, ...
    0.7381821882135022E+00, ...
   -0.7381821882135022E+00, ...
   -0.4979206093242921E+00, ...
    0.4979206093242922E+00, ...
    0.8494669121845019E+00, ...
   -0.8494669121845019E+00, ...
    0.4390176422841324E+00, ...
   -0.4390176422841323E+00, ...
    0.1590601194183188E+00, ...
   -0.1590601194183187E+00, ...
    0.8973818517920210E+00, ...
   -0.8973818517920210E+00, ...
    0.6726312443333152E+00, ...
   -0.6726312443333152E+00, ...
   -0.1686064273871127E+00, ...
    0.1686064273871128E+00, ...
   -0.3548241530243386E-18 ];
  ys = [ ...
   -0.9711078221435576E+00, ...
    0.9711078221435576E+00, ...
   -0.9668551959097115E+00, ...
    0.9668551959097113E+00, ...
   -0.9746926011666336E+00, ...
    0.9746926011666336E+00, ...
   -0.3231309208576288E+00, ...
    0.3231309208576288E+00, ...
   -0.9765444785368099E+00, ...
    0.9765444785368099E+00, ...
   -0.8490306235166675E+00, ...
    0.8490306235166672E+00, ...
   -0.7537198042004623E+00, ...
    0.7537198042004623E+00, ...
   -0.9737587969123404E+00, ...
    0.9737587969123406E+00, ...
   -0.3822148312292263E+00, ...
    0.3822148312292264E+00, ...
   -0.2988363050086515E+00, ...
    0.2988363050086515E+00, ...
    0.4849608774128832E+00, ...
   -0.4849608774128831E+00, ...
    0.2492237020321146E+00, ...
   -0.2492237020321144E+00, ...
   -0.3504141436316342E-01, ...
    0.3504141436316349E-01, ...
    0.6278936489285102E+00, ...
   -0.6278936489285100E+00, ...
   -0.8591476119499135E+00, ...
    0.8591476119499137E+00, ...
   -0.5892598635566724E+00, ...
    0.5892598635566724E+00, ...
    0.1438346146728415E+00, ...
   -0.1438346146728414E+00, ...
   -0.9289486752701194E+00, ...
    0.9289486752701194E+00, ...
   -0.8028060773786958E+00, ...
    0.8028060773786958E+00, ...
   -0.8651144139342870E+00, ...
    0.8651144139342870E+00, ...
   -0.5653829126627348E+00, ...
    0.5653829126627348E+00, ...
   -0.1574661586091270E+00, ...
    0.1574661586091272E+00, ...
   -0.7312745784466166E+00, ...
    0.7312745784466166E+00, ...
   -0.9115177107109407E+00, ...
    0.9115177107109407E+00, ...
   -0.6626783799774586E+00, ...
    0.6626783799774586E+00, ...
   -0.4696061222418765E+00, ...
    0.4696061222418766E+00, ...
   -0.9939228673343959E+00, ...
    0.9939228673343959E+00, ...
    0.3228625474392587E-19 ];
  ws = [ ...
    0.3224472434909546E-02, ...
    0.3224472434909546E-02, ...
    0.4080157527921578E-02, ...
    0.4080157527921578E-02, ...
    0.1406321867924724E-01, ...
    0.1406321867924724E-01, ...
    0.1094478053582958E+00, ...
    0.1094478053582958E+00, ...
    0.2046021623250057E-01, ...
    0.2046021623250057E-01, ...
    0.2244481290183435E-01, ...
    0.2244481290183435E-01, ...
    0.5310357585578484E-01, ...
    0.5310357585578484E-01, ...
    0.1049750419840204E-01, ...
    0.1049750419840204E-01, ...
    0.2100735514277743E-01, ...
    0.2100735514277743E-01, ...
    0.1140510361065565E+00, ...
    0.1140510361065565E+00, ...
    0.4811709451294231E-01, ...
    0.4811709451294231E-01, ...
    0.7994419804097108E-01, ...
    0.7994419804097108E-01, ...
    0.1010005451633049E+00, ...
    0.1010005451633049E+00, ...
    0.1204195881877324E-01, ...
    0.1204195881877324E-01, ...
    0.9474459024829298E-02, ...
    0.9474459024829298E-02, ...
    0.1005514424347678E+00, ...
    0.1005514424347678E+00, ...
    0.3161642787539286E-01, ...
    0.3161642787539286E-01, ...
    0.3963833050663004E-01, ...
    0.3963833050663004E-01, ...
    0.7350586661049985E-01, ...
    0.7350586661049985E-01, ...
    0.4319417861510279E-01, ...
    0.4319417861510279E-01, ...
    0.8810251098693814E-01, ...
    0.8810251098693814E-01, ...
    0.6864316028539075E-01, ...
    0.6864316028539075E-01, ...
    0.8257746135731812E-01, ...
    0.8257746135731812E-01, ...
    0.5439632620644287E-01, ...
    0.5439632620644287E-01, ...
    0.4386704732153978E-01, ...
    0.4386704732153978E-01, ...
    0.8808225769982879E-01, ...
    0.8808225769982879E-01, ...
    0.1534893259270625E-01, ...
    0.1534893259270625E-01, ...
    0.1234624197629746E+00 ];

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

  return
end