function xy = padua_points_set ( l )

%*****************************************************************************80
%
%% padua_points_set() sets the Padua points.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 August 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Marco Caliari, Stefano de Marchi, Marco Vianello,
%    Bivariate interpolation on the square at new nodal sets,
%    Applied Mathematics and Computation,
%    Volume 165, Number 2, 2005, pages 261-274.
%
%  Input:
%
%    integer L, the level.
%    0 <= L <= 10.
%
%  Output:
%
%    real XY(2,N), the Padua points.
%
  if ( l == 0 )

    xy = [ ...
      0.000000000000000, 0.000000000000000 ]';
 
  elseif ( l == 1 )

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...  
      -1.000000000000000,  1.000000000000000; ...
       1.000000000000000,  0.000000000000000 ]';

  elseif ( l == 2 )

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...
      -1.000000000000000,  0.5000000000000001; ...
       0.000000000000000, -0.4999999999999998; ...  
       0.000000000000000,  1.000000000000000; ...    
       1.000000000000000, -1.000000000000000; ...
       1.000000000000000,  0.5000000000000001 ]';
 
  elseif ( l == 3 )

    xy = [ ...
      -1.000000000000000,  -1.000000000000000; ...    
      -1.000000000000000,   0.000000000000000; ...
      -1.000000000000000,   1.000000000000000; ...    
      -0.4999999999999998, -0.7071067811865475; ...    
      -0.4999999999999998,  0.7071067811865476; ...    
       0.5000000000000001, -1.000000000000000; ...    
       0.5000000000000001,  0.000000000000000; ...    
       0.5000000000000001,  1.000000000000000; ...    
       1.000000000000000,  -0.7071067811865475; ...    
       1.000000000000000,   0.7071067811865476 ]';
  
  elseif ( l == 4 )

    xy = [ ...
      -1.000000000000000,  -1.000000000000000; ...
      -1.000000000000000,  -0.3090169943749473; ...
      -1.000000000000000,   0.8090169943749475; ...
      -0.7071067811865475, -0.8090169943749473; ...
      -0.7071067811865475,  0.3090169943749475; ...
      -0.7071067811865475,  1.000000000000000; ...
       0.000000000000000,  -1.000000000000000; ...
       0.000000000000000,  -0.3090169943749473; ...
       0.000000000000000,   0.8090169943749475; ...
       0.7071067811865476, -0.8090169943749473; ...
       0.7071067811865476,  0.3090169943749475; ...
       0.7071067811865476,  1.000000000000000; ...
       1.000000000000000,  -1.000000000000000; ...
       1.000000000000000,  -0.3090169943749473; ...
       1.000000000000000,   0.8090169943749475 ]';

  elseif ( l == 5 )

    xy = [ ...
      -1.000000000000000,  -1.000000000000000; ...
      -1.000000000000000,  -0.4999999999999998; ...   
      -1.000000000000000,   0.5000000000000001; ...    
      -1.000000000000000,   1.000000000000000; ...   
      -0.8090169943749473, -0.8660254037844387; ...
      -0.8090169943749473,  0.000000000000000; ... 
      -0.8090169943749473,  0.8660254037844387; ...
      -0.3090169943749473, -1.000000000000000; ... 
      -0.3090169943749473, -0.4999999999999998; ...   
      -0.3090169943749473,  0.5000000000000001; ...
      -0.3090169943749473,  1.000000000000000; ... 
       0.3090169943749475, -0.8660254037844387; ...
       0.3090169943749475,  0.000000000000000; ...  
       0.3090169943749475,  0.8660254037844387; ...   
       0.8090169943749475, -1.000000000000000; ...  
       0.8090169943749475, -0.4999999999999998; ...  
       0.8090169943749475,  0.5000000000000001; ...
       0.8090169943749475,  1.000000000000000; ...
       1.000000000000000,  -0.8660254037844387; ...   
       1.000000000000000,   0.000000000000000; ...
       1.000000000000000,   0.8660254037844387 ]';

  elseif ( l == 6 )   

    xy = [ ...
      -1.000000000000000,  -1.000000000000000; ...  
      -1.000000000000000,  -0.6234898018587335; ...    
      -1.000000000000000,   0.2225209339563144; ...    
      -1.000000000000000,   0.9009688679024191; ...    
      -0.8660254037844387, -0.9009688679024190; ...    
      -0.8660254037844387, -0.2225209339563143; ... 
      -0.8660254037844387,  0.6234898018587336; ...
      -0.8660254037844387,  1.000000000000000; ...
      -0.4999999999999998, -1.000000000000000; ...  
      -0.4999999999999998, -0.6234898018587335; ...    
      -0.4999999999999998,  0.2225209339563144; ...    
      -0.4999999999999998,  0.9009688679024191; ...    
       0.000000000000000,  -0.9009688679024190; ... 
       0.000000000000000,  -0.2225209339563143; ...
       0.000000000000000,   0.6234898018587336; ...    
       0.000000000000000,   1.000000000000000; ...
       0.5000000000000001, -1.000000000000000; ...   
       0.5000000000000001, -0.6234898018587335; ...    
       0.5000000000000001,  0.2225209339563144; ...    
       0.5000000000000001,  0.9009688679024191; ...    
       0.8660254037844387, -0.9009688679024190; ...    
       0.8660254037844387, -0.2225209339563143; ... 
       0.8660254037844387,  0.6234898018587336; ...
       0.8660254037844387,  1.000000000000000; ...    
       1.000000000000000,  -1.000000000000000; ...  
       1.000000000000000,  -0.6234898018587335; ... 
       1.000000000000000,   0.2225209339563144; ...
       1.000000000000000,   0.9009688679024191 ]';

  elseif ( l == 7 )    

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...
      -1.000000000000000, -0.7071067811865475; ...    
      -1.000000000000000,  0.000000000000000; ...
      -1.000000000000000,  0.7071067811865476; ... 
      -1.000000000000000,  1.000000000000000; ...  
      -0.9009688679024190, -0.9238795325112867; ...    
      -0.9009688679024190, -0.3826834323650897; ...    
      -0.9009688679024190,  0.3826834323650898; ... 
      -0.9009688679024190,  0.9238795325112867; ...
      -0.6234898018587335, -1.000000000000000; ...
      -0.6234898018587335, -0.7071067811865475; ...
      -0.6234898018587335,  0.000000000000000; ...
      -0.6234898018587335,  0.7071067811865476; ...
      -0.6234898018587335, 1.000000000000000; ... 
      -0.2225209339563143, -0.9238795325112867; ...    
      -0.2225209339563143, -0.3826834323650897; ...    
      -0.2225209339563143,  0.3826834323650898; ... 
      -0.2225209339563143,  0.9238795325112867; ...
       0.2225209339563144, -1.000000000000000; ...
       0.2225209339563144, -0.7071067811865475; ...
       0.2225209339563144,  0.000000000000000; ...
       0.2225209339563144,  0.7071067811865476; ...
       0.2225209339563144,  1.000000000000000; ...  
       0.6234898018587336, -0.9238795325112867; ...    
       0.6234898018587336, -0.3826834323650897; ...    
       0.6234898018587336,  0.3826834323650898; ... 
       0.6234898018587336,  0.9238795325112867; ...
       0.9009688679024191, -1.000000000000000; ...
       0.9009688679024191, -0.7071067811865475; ...
       0.9009688679024191,  0.000000000000000; ...
       0.9009688679024191,  0.7071067811865476; ...
       0.9009688679024191,  1.000000000000000; ...   
       1.000000000000000, -0.9238795325112867; ...    
       1.000000000000000, -0.3826834323650897; ...    
       1.000000000000000,  0.3826834323650898; ...
       1.000000000000000,  0.9238795325112867 ]';

  elseif ( l == 8 ) 

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...   
      -1.000000000000000, -0.7660444431189779; ...    
      -1.000000000000000, -0.1736481776669303; ...    
      -1.000000000000000,  0.5000000000000001; ...    
      -1.000000000000000,  0.9396926207859084; ...    
      -0.9238795325112867, -0.9396926207859083; ...    
      -0.9238795325112867, -0.4999999999999998; ...    
      -0.9238795325112867,  0.1736481776669304; ...    
      -0.9238795325112867,  0.7660444431189780; ...
      -0.9238795325112867,  1.000000000000000; ...
      -0.7071067811865475, -1.000000000000000; ...   
      -0.7071067811865475, -0.7660444431189779; ...    
      -0.7071067811865475, -0.1736481776669303; ...    
      -0.7071067811865475,  0.5000000000000001; ...    
      -0.7071067811865475,  0.9396926207859084; ...    
      -0.3826834323650897, -0.9396926207859083; ...    
      -0.3826834323650897, -0.4999999999999998; ...    
      -0.3826834323650897,  0.1736481776669304; ...    
      -0.3826834323650897,  0.7660444431189780; ...
      -0.3826834323650897,  1.000000000000000; ...    
       0.000000000000000, -1.000000000000000; ...   
       0.000000000000000, -0.7660444431189779; ...    
       0.000000000000000, -0.1736481776669303; ...    
       0.000000000000000,  0.5000000000000001; ...    
       0.000000000000000,  0.9396926207859084; ...    
       0.3826834323650898, -0.9396926207859083; ...    
       0.3826834323650898, -0.4999999999999998; ...    
       0.3826834323650898,  0.1736481776669304; ...    
       0.3826834323650898,  0.7660444431189780; ...
       0.3826834323650898,  1.000000000000000; ...
       0.7071067811865476, -1.000000000000000; ...   
       0.7071067811865476, -0.7660444431189779; ...    
       0.7071067811865476, -0.1736481776669303; ...    
       0.7071067811865476,  0.5000000000000001; ...    
       0.7071067811865476,  0.9396926207859084; ...    
       0.9238795325112867, -0.9396926207859083; ...    
       0.9238795325112867, -0.4999999999999998; ...    
       0.9238795325112867,  0.1736481776669304; ...    
       0.9238795325112867,  0.7660444431189780; ...
       0.9238795325112867,  1.000000000000000; ...    
       1.000000000000000, -1.000000000000000; ...   
       1.000000000000000, -0.7660444431189779; ...    
       1.000000000000000, -0.1736481776669303; ...  
       1.000000000000000,  0.5000000000000001; ...
       1.000000000000000,  0.9396926207859084 ]';

  elseif ( l == 9 ) 

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...   
      -1.000000000000000, -0.8090169943749473; ...    
      -1.000000000000000, -0.3090169943749473; ...    
      -1.000000000000000,  0.3090169943749475; ...
      -1.000000000000000,  0.8090169943749475; ...    
      -1.000000000000000,  1.000000000000000; ...   
      -0.9396926207859083, -0.9510565162951535; ...    
      -0.9396926207859083, -0.5877852522924730; ...
      -0.9396926207859083,  0.000000000000000; ...   
      -0.9396926207859083,  0.5877852522924731; ...    
      -0.9396926207859083,  0.9510565162951535; ...
      -0.7660444431189779, -1.000000000000000; ...   
      -0.7660444431189779, -0.8090169943749473; ...    
      -0.7660444431189779, -0.3090169943749473; ...    
      -0.7660444431189779,  0.3090169943749475; ...    
      -0.7660444431189779,  0.8090169943749475; ... 
      -0.7660444431189779,  1.000000000000000; ...   
      -0.4999999999999998, -0.9510565162951535; ...    
      -0.4999999999999998, -0.5877852522924730; ...
      -0.4999999999999998,  0.000000000000000; ...   
      -0.4999999999999998,  0.5877852522924731; ...    
      -0.4999999999999998,  0.9510565162951535; ...
      -0.1736481776669303, -1.000000000000000; ...   
      -0.1736481776669303, -0.8090169943749473; ...    
      -0.1736481776669303, -0.3090169943749473; ...    
      -0.1736481776669303,  0.3090169943749475; ...    
      -0.1736481776669303,  0.8090169943749475; ...
      -0.1736481776669303,  1.000000000000000; ...   
       0.1736481776669304, -0.9510565162951535; ...    
       0.1736481776669304, -0.5877852522924730; ...
       0.1736481776669304,  0.000000000000000; ...   
       0.1736481776669304,  0.5877852522924731; ...    
       0.1736481776669304,  0.9510565162951535; ...
       0.5000000000000001, -1.000000000000000; ...   
       0.5000000000000001, -0.8090169943749473; ...    
       0.5000000000000001, -0.3090169943749473; ...    
       0.5000000000000001,  0.3090169943749475; ...    
       0.5000000000000001,  0.8090169943749475; ...
       0.5000000000000001,  1.000000000000000; ...   
       0.7660444431189780, -0.9510565162951535; ...    
       0.7660444431189780, -0.5877852522924730; ...
       0.7660444431189780,  0.000000000000000; ...   
       0.7660444431189780,  0.5877852522924731; ...    
       0.7660444431189780,  0.9510565162951535; ...
       0.9396926207859084, -1.000000000000000; ...   
       0.9396926207859084, -0.8090169943749473; ...    
       0.9396926207859084, -0.3090169943749473; ...    
       0.9396926207859084,  0.3090169943749475; ...    
       0.9396926207859084,  0.8090169943749475; ...
       0.9396926207859084,  1.000000000000000; ...   
       1.000000000000000, -0.9510565162951535; ...
       1.000000000000000, -0.5877852522924730; ...    
       1.000000000000000,  0.000000000000000; ...
       1.000000000000000,  0.5877852522924731; ...
       1.000000000000000,  0.9510565162951535 ]'; 

  elseif ( l == 10 )

    xy = [ ...
      -1.000000000000000, -1.000000000000000; ...   
      -1.000000000000000, -0.8412535328311811; ...    
      -1.000000000000000, -0.4154150130018863; ...    
      -1.000000000000000,  0.1423148382732851; ...    
      -1.000000000000000,  0.6548607339452851; ...    
      -1.000000000000000,  0.9594929736144974; ...    
      -0.9510565162951535, -0.9594929736144974; ...    
      -0.9510565162951535, -0.6548607339452850; ...    
      -0.9510565162951535, -0.1423148382732850; ...    
      -0.9510565162951535,  0.4154150130018864; ...    
      -0.9510565162951535,  0.8412535328311812; ...
      -0.9510565162951535,  1.000000000000000; ...
      -0.8090169943749473, -1.000000000000000; ...   
      -0.8090169943749473, -0.8412535328311811; ...    
      -0.8090169943749473, -0.4154150130018863; ...    
      -0.8090169943749473,  0.1423148382732851; ...    
      -0.8090169943749473,  0.6548607339452851; ...    
      -0.8090169943749473,  0.9594929736144974; ...    
      -0.5877852522924730, -0.9594929736144974; ...    
      -0.5877852522924730, -0.6548607339452850; ...    
      -0.5877852522924730, -0.1423148382732850; ...    
      -0.5877852522924730,  0.4154150130018864; ...    
      -0.5877852522924730,  0.8412535328311812; ...
      -0.5877852522924730,  1.000000000000000; ...
      -0.3090169943749473, -1.000000000000000; ...   
      -0.3090169943749473, -0.8412535328311811; ...    
      -0.3090169943749473, -0.4154150130018863; ...    
      -0.3090169943749473,  0.1423148382732851; ...    
      -0.3090169943749473,  0.6548607339452851; ...   
      -0.3090169943749473, 0.9594929736144974; ...    
       0.000000000000000, -0.9594929736144974; ...    
       0.000000000000000, -0.6548607339452850; ...    
       0.000000000000000, -0.1423148382732850; ...    
       0.000000000000000,  0.4154150130018864; ...
       0.000000000000000,  0.8412535328311812; ...    
       0.000000000000000,  1.000000000000000; ... 
       0.3090169943749475, -1.000000000000000; ...    
       0.3090169943749475, -0.8412535328311811; ...    
       0.3090169943749475, -0.4154150130018863; ...    
       0.3090169943749475,  0.1423148382732851; ...    
       0.3090169943749475,  0.6548607339452851; ...    
       0.3090169943749475,  0.9594929736144974; ...    
       0.5877852522924731, -0.9594929736144974; ...    
       0.5877852522924731, -0.6548607339452850; ...    
       0.5877852522924731, -0.1423148382732850; ...    
       0.5877852522924731,  0.4154150130018864; ...    
       0.5877852522924731,  0.8412535328311812; ...
       0.5877852522924731, 1.000000000000000; ...
       0.8090169943749475, -1.000000000000000; ...   
       0.8090169943749475, -0.8412535328311811; ...    
       0.8090169943749475, -0.4154150130018863; ...    
       0.8090169943749475,  0.1423148382732851; ...    
       0.8090169943749475,  0.6548607339452851; ...    
       0.8090169943749475,  0.9594929736144974; ...    
       0.9510565162951535, -0.9594929736144974; ...    
       0.9510565162951535, -0.6548607339452850; ...    
       0.9510565162951535, -0.1423148382732850; ...    
       0.9510565162951535,  0.4154150130018864; ...    
       0.9510565162951535,  0.8412535328311812; ...
       0.9510565162951535,  1.000000000000000; ...    
       1.000000000000000, -1.000000000000000; ...   
       1.000000000000000, -0.8412535328311811; ...    
       1.000000000000000, -0.4154150130018863; ...    
       1.000000000000000,  0.1423148382732851; ...    
       1.000000000000000,  0.6548607339452851; ...
       1.000000000000000,  0.9594929736144974 ]'; 

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'PADUA_POINTS_SET - Fatal error!\n' );
    fprintf ( 1, '  Illegal value of L = %d\n', l );
    fprintf ( 1, '  Legal values are 0 through 10.\n' );
    error ( 'PADUA_POINTS_SET - Fatal error!' )

  end
%
%  Reverse the order to match the published data.
%
  n = floor ( ( l + 1 ) * ( l + 2 ) ) / 2;
  j1_hi = floor ( n / 2 );

  for j1 = 1 : j1_hi
    j2 = n + 1 - j1;
    t        = xy(1,j1);
    xy(1,j1) = xy(1,j2);
    xy(1,j2) = t;
    t        = xy(2,j1);
    xy(2,j1) = xy(2,j2);
    xy(2,j2) = t;
  end

  return
end
