x <- seq(from=-1, to=1, by=0.05)
gegenpoly_1(0.5 , x)
gegenpoly_2(0.5 , x)
gegenpoly_3(0.5 , x)
gegenpoly_n(6, 0.5 , x)
gegenpoly_array(6, 0.5 , x)
x <- seq(from=-1 ,to=1,len=30)
y <- gegenpoly_array(6,0.5,x)
matplot(x,t(y[-(1:2),]),type="l") #figure 22.4, page 776
plot(x,xlim=c(-1,1),ylim=c(-1.5,1.5),type="n",main="Figure 22.5, p777")
lines(x, gegenpoly_n(5,lambda=0.2, x,give=FALSE,strict=TRUE))
lines(x, gegenpoly_n(5,lambda=0.4, x,give=FALSE,strict=TRUE))
lines(x, gegenpoly_n(5,lambda=0.6, x,give=FALSE,strict=TRUE))
lines(x, gegenpoly_n(5,lambda=0.8, x,give=FALSE,strict=TRUE))
lines(x, gegenpoly_n(5,lambda=1.0, x,give=FALSE,strict=TRUE))
abline(h=0)
abline(v=0)
Run the code above in your browser using DataCamp Workspace