chebPoly.RdChebyshev polynomials and their values.
chebPoly(n, x = NULL)Determines an (n+1)-ny-(n+1)-Matrix of Chebyshev polynomials up to degree n.
The coefficients of the first n Chebyshev polynomials are computed
using the recursion formula. For computing any values at points the well
known Horner schema is applied.
If x is NULL, returns an (n+1)-by-(n+1) matrix
with the coefficients of the first Chebyshev polynomials from 0 to
n, one polynomial per row with coefficients from highest to lowest
order.
If x is a numeric vector, returns the values of the n-th
Chebyshev polynomial at the points of x.
Carothers, N. L. (1998). A Short Course on Approximation Theory. Bowling Green State University.
See the “Chebfun Project” <https://www.chebfun.org/> by Nick Trefethen.
chebPoly(6)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 0 0 0 0 0 0 1
#> [2,] 0 0 0 0 0 1 0
#> [3,] 0 0 0 0 2 0 -1
#> [4,] 0 0 0 4 0 -3 0
#> [5,] 0 0 8 0 -8 0 1
#> [6,] 0 16 0 -20 0 5 0
#> [7,] 32 0 -48 0 18 0 -1
if (FALSE) { # \dontrun{
## Plot 6 Chebyshev Polynomials
plot(0, 0, type="n", xlim=c(-1, 1), ylim=c(-1.2, 1.2),
main="Chebyshev Polynomials for n=1..6", xlab="x", ylab="y")
grid()
x <- seq(-1, 1, length.out = 101)
for (i in 1:6) {
y <- chebPoly(i, x)
lines(x, y, col=i)
}
legend(x = 0.55, y = 1.2, c("n=1", "n=2", "n=3", "n=4", "n=5", "n=6"),
col = 1:6, lty = 1, bg="whitesmoke", cex = 0.75)
} # }