Thursday, December 26, 2024
Google search engine
HomeLanguagesPython | Numpy np.hermevander3d() method

Python | Numpy np.hermevander3d() method

With the help of np.hermevander3d() method, we can get the pseudo vandermonde matrix of a given 3-D data having degrees x, y and z by using np.hermevander3d() method.

Syntax : np.hermevander3d(x, y, z, [x_deg, y_deg, z_deg])

Return : Return the pseudo vandermonde matrix of given 3-D data.

Example #1 :
In this example we can see that by using np.hermevander3d() method, we are able to get the pseudo vandermonde matrix of a given 3-D data having degree (x, y, z) by using this method.




# import numpy and hermevander3d
import numpy as np
from numpy.polynomial.hermite_e import hermevander3d
  
x = np.array([1, 0.1])
y = np.array([2, 0.2])
z = np.array([3, 0.3])
x_deg, y_deg, z_deg = 2, 3, 1
  
# using np.hermevander3d() method
gfg = hermevander3d(x, y, z, [x_deg, y_deg, z_deg])
  
print(gfg)


Output :

[[ 1.00000e+00 3.00000e+00 2.00000e+00 6.00000e+00 3.00000e+00
9.00000e+00 2.00000e+00 6.00000e+00 1.00000e+00 3.00000e+00
2.00000e+00 6.00000e+00 3.00000e+00 9.00000e+00 2.00000e+00
6.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00
0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00]
[ 1.00000e+00 3.00000e-01 2.00000e-01 6.00000e-02 -9.60000e-01
-2.88000e-01 -5.92000e-01 -1.77600e-01 1.00000e-01 3.00000e-02
2.00000e-02 6.00000e-03 -9.60000e-02 -2.88000e-02 -5.92000e-02
-1.77600e-02 -9.90000e-01 -2.97000e-01 -1.98000e-01 -5.94000e-02
9.50400e-01 2.85120e-01 5.86080e-01 1.75824e-01]]

Example #2 :




# import numpy and hermevander3d
import numpy as np
from numpy.polynomial.hermite_e import hermevander3d
  
x = np.array([1.01, 2.02, 3.03])
y = np.array([10.1, 20.2, 30.3])
z = np.array([0.1, 0.2, 0.3])
x_deg, y_deg, z_deg = 1, 1, 3
  
# using np.hermevander3d() method
gfg = hermevander3d(x, y, z, [x_deg, y_deg, z_deg])
  
print(gfg)


Output :

[[ 1. 0.1 -0.99 -0.299 10.1 1.01
-9.999 -3.0199 1.01 0.101 -0.9999 -0.30199
10.201 1.0201 -10.09899 -3.050099]
[ 1. 0.2 -0.96 -0.592 20.2 4.04
-19.392 -11.9584 2.02 0.404 -1.9392 -1.19584
40.804 8.1608 -39.17184 -24.155968]
[ 1. 0.3 -0.91 -0.873 30.3 9.09
-27.573 -26.4519 3.03 0.909 -2.7573 -2.64519
91.809 27.5427 -83.54619 -80.149257]]

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments