Python | Numpy np.chebgrid3d() method (original) (raw)

Last Updated : 11 Nov, 2019

With the help of **np.chebgrid3d()** method, we can get the array of coefficients after evaluation the chebyshev series on cartesian product of x, y and z by using np.chebgrid3d() method.

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

Example #1 :
In this example we can see that by using np.chebgrid3d() method, we are able to get the array of coefficients by evaluating the chebyshev series on the cartesian product of x, y and z.

import numpy as np

import numpy.polynomial.chebyshev as cheb

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

print (gfg)

Output :

[502. 596. -250.]

Example #2 :

import numpy as np

import numpy.polynomial.chebyshev as cheb

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

print (gfg)

Output :

[57913404. 97926342. 4230432.]

Similar Reads