Files
PINA/pina/chebyshev.py
2021-11-29 15:29:00 +01:00

7 lines
230 B
Python

from mpmath import chebyt, chop, taylor
import numpy as np
def chebyshev_roots(n):
""" Return the roots of *n* Chebyshev polynomials (between [-1, 1]) """
return np.roots(chop(taylor(lambda x: chebyt(n, x), 0, n))[::-1])