Could you help me write elegant form of formula for Chebysev nodes in $[a,b]$ ? Size of vector of points is $n$.
I am working with octave, but the most important thing is: How to formulate it clear and elegant ?
Could you help me write elegant form of formula for Chebysev nodes in $[a,b]$ ? Size of vector of points is $n$.
I am working with octave, but the most important thing is: How to formulate it clear and elegant ?
Consider $n$ Chebyshev interpolation points $x_k=\cos\frac{\pi}2 \frac{2k+1}{n}\in[-1,1]$, $k=0,1,2,\dots, n-1$. Use $x_k$ to define $z_k\in [a,b]$ as following $${z_k} = \frac{{a + b}}{2} + \frac{{b - a}}{2}{x_k}$$
k=0:(n-1);
nodes = cos( (pi/2) * (2*k+1)/(n) ) ;
nodes = (a+b)/2 + nodes*(b-a)/2;
nodes = cos(pi/n*((1:n)-.5))– Dec 28 '15 at 23:24