function [ x, w ] = chebyshev1_set ( n )

%*****************************************************************************80
%
%% CHEBYSHEV1_SET sets a Chebyshev Type 1 quadrature rule.
%
%  Discussion:
%
%    The integral:
%
%      integral ( -1 <= x <= 1 ) f(x) / sqrt ( 1 - x * x ) dx
%
%    The quadrature rule:
%
%      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    27 May 2014
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order.
%    N must be between 1 and 10.
%
%    Output, real X(N), the abscissas.
%
%    Output, real W(N), the weights.
%
  if ( n == 1 )
    x( 1) =   0.0;
    w( 1) =    3.141592653589793;
  elseif ( n == 2 )
    x( 1) =  -0.7071067811865475;
    x( 2) =   0.7071067811865476;
    w( 1) =    1.570796326794897;
    w( 2) =    1.570796326794897;
  elseif ( n == 3 )  
    x( 1) =  -0.8660254037844387;
    x( 2) =   0.0;
    x( 3) =   0.8660254037844387;
    w( 1) =    1.047197551196598;
    w( 2) =    1.047197551196598;
    w( 3) =    1.047197551196598;
  elseif ( n == 4 )
    x( 1) =  -0.9238795325112867;    
    x( 2) =  -0.3826834323650897;    
    x( 3) =   0.3826834323650898;    
    x( 4) =   0.9238795325112867;    
    w( 1) =   0.7853981633974483;    
    w( 2) =   0.7853981633974483;    
    w( 3) =   0.7853981633974483;
    w( 4) =   0.7853981633974483;
  elseif ( n == 5 )
    x( 1) =  -0.9510565162951535;    
    x( 2) =  -0.5877852522924730;
    x( 3) =   0.0;
    x( 4) =   0.5877852522924731;    
    x( 5) =   0.9510565162951535;    
    w( 1) =   0.6283185307179586;    
    w( 2) =   0.6283185307179586;    
    w( 3) =   0.6283185307179586;    
    w( 4) =   0.6283185307179586;    
    w( 5) =   0.6283185307179586;
  elseif ( n == 6 )
    x( 1) =  -0.9659258262890682;    
    x( 2) =  -0.7071067811865475;    
    x( 3) =  -0.2588190451025206;    
    x( 4) =   0.2588190451025207;    
    x( 5) =   0.7071067811865476;    
    x( 6) =   0.9659258262890683;    
    w( 1) =   0.5235987755982988;    
    w( 2) =   0.5235987755982988;    
    w( 3) =   0.5235987755982988;    
    w( 4) =   0.5235987755982988;    
    w( 5) =   0.5235987755982988;    
    w( 6) =   0.5235987755982988;
  elseif ( n == 7 )
    x( 1) =  -0.9749279121818237;    
    x( 2) =  -0.7818314824680295;    
    x( 3) =  -0.4338837391175581;    
    x( 4) =   0.0;
    x( 5) =   0.4338837391175582;    
    x( 6) =   0.7818314824680298;    
    x( 7) =   0.9749279121818236;    
    w( 1) =   0.4487989505128276;    
    w( 2) =   0.4487989505128276;    
    w( 3) =   0.4487989505128276;    
    w( 4) =   0.4487989505128276;    
    w( 5) =   0.4487989505128276;    
    w( 6) =   0.4487989505128276;    
    w( 7) =   0.4487989505128276;
  elseif ( n == 8 )
    x( 1) =  -0.9807852804032304;    
    x( 2) =  -0.8314696123025453;    
    x( 3) =  -0.5555702330196020;    
    x( 4) =  -0.1950903220161282;    
    x( 5) =   0.1950903220161283;    
    x( 6) =   0.5555702330196023;    
    x( 7) =   0.8314696123025452;    
    x( 8) =   0.9807852804032304;    
    w( 1) =   0.3926990816987241;    
    w( 2) =   0.3926990816987241;    
    w( 3) =   0.3926990816987241;    
    w( 4) =   0.3926990816987241;    
    w( 5) =   0.3926990816987241;    
    w( 6) =   0.3926990816987241;    
    w( 7) =   0.3926990816987241;    
    w( 8) =   0.3926990816987241;
  elseif ( n == 9 )
    x( 1) =  -0.9848077530122080;    
    x( 2) =  -0.8660254037844385;    
    x( 3) =  -0.6427876096865394;    
    x( 4) =  -0.3420201433256685;
    x( 5) =   0.0;
    x( 6) =   0.3420201433256688;    
    x( 7) =   0.6427876096865394;    
    x( 8) =   0.8660254037844387;    
    x( 9) =   0.9848077530122080;
    w( 1) =   0.3490658503988659;    
    w( 2) =   0.3490658503988659;    
    w( 3) =   0.3490658503988659;    
    w( 4) =   0.3490658503988659;    
    w( 5) =   0.3490658503988659;    
    w( 6) =   0.3490658503988659;    
    w( 7) =   0.3490658503988659;    
    w( 8) =   0.3490658503988659;    
    w( 9) =   0.3490658503988659; 
  elseif ( n == 10 )
    x( 1) =  -0.9876883405951377;    
    x( 2) =  -0.8910065241883678;    
    x( 3) =  -0.7071067811865475;    
    x( 4) =  -0.4539904997395467;    
    x( 5) =  -0.1564344650402306;    
    x( 6) =   0.1564344650402309;    
    x( 7) =   0.4539904997395468;    
    x( 8) =   0.7071067811865476;    
    x( 9) =   0.8910065241883679;    
    x(10) =   0.9876883405951378;    
    w( 1) =   0.3141592653589793;    
    w( 2) =   0.3141592653589793;    
    w( 3) =   0.3141592653589793;    
    w( 4) =   0.3141592653589793;    
    w( 5) =   0.3141592653589793;    
    w( 6) =   0.3141592653589793;    
    w( 7) =   0.3141592653589793;    
    w( 8) =   0.3141592653589793;    
    w( 9) =   0.3141592653589793;
    w(10) =   0.3141592653589793;
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 'CHEBYSHEV1_SET - Fatal error!\n' );
    fprintf ( 1, '  Illegal value of N = %d\n', n );
    fprintf ( 1, '  Legal values are 1 through 10.\n' );
    error ( 'CHEBYSHEV1_SET - Fatal error!' );
  end
%
%  Destroy all row vectors!
%
  x = x(:);
  w = w(:);

  return
end
