mathjs icon indicating copy to clipboard operation
mathjs copied to clipboard

Quick and Easy Chebyshev T function

Open Bobingstern opened this issue 3 years ago • 1 comments

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

Bobingstern avatar Apr 27 '23 15:04 Bobingstern

May I know what the problem in it then.

Amanpatel2002-g avatar Apr 29 '23 11:04 Amanpatel2002-g