With the help of np.chebroots()
method, we can get the roots of chebyshev series by using np.chebroots()
method.
Syntax :
np.chebroots(array of coefficients)
Return : Return the array having roots of chebyshev series.
Example #1 :
In this example we can see that by using np.chebroots()
method, we are able to get the roots of chebyshev series by using this method.
# import numpy import numpy as np import numpy.polynomial.chebyshev as cheb # using np.chebroots() method gfg = cheb.chebroots(( 2 , 4 , 8 , 1 )) print (gfg) |
Output :
[-3.83265557 -0.71484143 0.54749701]
Example #2 :
# import numpy import numpy as np import numpy.polynomial.chebyshev as cheb # using np.chebroots() method gfg = cheb.chebroots(( - 3 , 4 , - 5 , 1 , 10 )) print (gfg) |
Output :
[-1.02213642 -0.38135467 0.40624906 0.94724203]