mathjs
mathjs copied to clipboard
Quick and Easy Chebyshev T function
Chebyshev polynomials of the first kind $T_n(x)$ can be implemented super easily using their trigonometric definition and as a result can be extended to complex values of n and x. For values of $|x|\leq 1$ $T_n(x)=\cos(n\arccos(x))$ and for $|x| \geq 1$ $T_n(x)=\frac{1}{2}((x-\sqrt{x^2-1})^n+(x+\sqrt{x^2-1})^n)$
This is ridiculously easy to implement in math.js. The function name could be ChebyshevT just like that of Wolfram Mathematica
May I know what the problem in it then.