def chebyt(n, monic=False):
 if (n < 0):
  raise ValueError('n must be nonnegative.')
 wfunc = (lambda x: (1.0 / sqrt((1 - (x * x)))))
 if (n == 0):
  return orthopoly1d([], [], pi, 1.0, wfunc, ((-1), 1), monic, (lambda x: eval_chebyt(n, x)))
 n1 = n
 (x, w, mu) = roots_chebyt(n1, mu=True)
 hn = (pi / 2)
 kn = (2 ** (n - 1))
 p = orthopoly1d(x, w, hn, kn, wfunc, ((-1), 1), monic, (lambda x: eval_chebyt(n, x)))
 return p

def chebyt ( n , monic = False ) : if ( n < 0 ) : raise ValueError ( 'n must be nonnegative.' ) wfunc = ( lambda x : ( 1.0 / sqrt ( ( 1 - ( x * x ) ) ) ) ) if ( n == 0 ) : return orthopoly1d ( [ ] , [ ] , pi , 1.0 , wfunc , ( ( - 1 ) , 1 ) , monic , ( lambda x : eval_chebyt ( n , x ) ) ) n1 = n ( x , w , mu ) = roots_chebyt ( n1 , mu = True ) hn = ( pi / 2 ) kn = ( 2 ** ( n - 1 ) ) p = orthopoly1d ( x , w , hn , kn , wfunc , ( ( - 1 ) , 1 ) , monic , ( lambda x : eval_chebyt ( n , x ) ) ) return p
chebyshev polynomial of the first kind .