      program cheby
      dimension xray(101),yray(101)
      n=3
      call metafl('cons')
      CALL DISINI
      CALL GRAF(-1.,1.,-1.,0.2,-1.,1.,-1.,4.e-1)
      CALL rline(-1.0,0.0,1.0,0.0)
      call rline(0.0,-1.0,0.0,1.0)
           NX=NXPOSN(-0.3)
           NY=NYPOSN(1.2)
      CALL MESSAG('Chebyshev polynoms',NX,NY)
      CALL COLOR('red')
      do j=1,n
        x=-1.0
        do i=1,101
           xray(i)=x
           yray(i)=t(x,j)
           x=x+0.02
        end do
c
        CALL curve(xray,yray,101)
      end do
      CALL COLOR('white')
      CALL DISFIN
      end       
c
      function t(x,n)
      dimension tt(0:20)
      tt(0)=1.
      tt(1)=x
      do i=2,n
          tt(i)=2.*x*tt(i-1)-tt(i-2)
      end do
      t=tt(n)
      return
      end
