Python | Numpy np.chebval2d () method

Using the method np.chebval2d() , we can get an array of coefficients after evaluating by (x, y) on Chebyshev series using np.chebval2d ( ) .

Syntax: np.chebval2d (x, y, c)
Return : Return an array after evaluation on (x, y).

Example # 1:
In this example, we see that using np.chebval2d () we can get an array of coefficients by evaluating (x, y) by Chebyshev series.

# import NumPy

import numpy as np

import numpy.polynomial.chebyshev as cheb

 
# using the np.chebval2d () method

gfg = cheb.chebval2d (( 2 , 5 ), ( 1 , 3 ), ( 2 , - 4 , 1 ))

 

print ( gfg)

Output:

[32. 94.]

Example # 2:

# NumPy import

import numpy as np

import numpy.polynomial.chebyshev as cheb

 
# using the np.chebval2d () method

gfg = cheb.chebval2d (( 1 , 3 , 5 , 7 ), ( 2 , 4 , 8 ), ( 2 , - 4 , 1 , 5 , 1 ))

 

print (gfg)

Exit :

[719680. 6486180.52831708.]