점(x, y, z)에서 3D Hermite 시리즈를 평가하려면 PythonNumpy에서 hermite.hermval3d() 메서드를 사용합니다. 이 메서드는 x, y 및 z에서 해당 값의 3배로 구성된 점에 대한 다차원 다항식 값을 반환합니다. 첫 번째 매개변수는 x,y,z입니다. 3차원 계열은 점(x, y, z)에서 평가되며 여기서 x, y 및 z는 모양이 동일해야 합니다. x, y, orz 중 하나라도 목록이나 튜플이면 먼저 ndarray로 변환하고, 그렇지 않으면 변경하지 않고 그대로 두고 ndarray가 아니면 스칼라로 처리합니다.
두 번째 매개변수 C는 다차,j,k항의 계수가 c[i,j,k]에 포함되도록 정렬된 계수의 배열입니다. c의 차원이 3보다 큰 경우 나머지 인덱스는 여러 계수 세트를 열거합니다.
단계
먼저 필요한 라이브러리를 가져옵니다 -
import numpy as np from numpy.polynomial import hermite as H
계수의 4차원 배열 생성 -
c = np.arange(48).reshape(2,2,6,2)
배열 표시 -
print("Our Array...\n",c) 치수 확인 -
print("\nDimensions of our Array...\n",c.ndim) 데이터 유형 가져오기 -
print("\nDatatype of our Array object...\n",c.dtype) 모양 가져오기 -
print("\nShape of our Array object...\n",c.shape) 점 (x, y, z)에서 3D Hermite 시리즈를 평가하려면 PythonNumpy에서 hermite.hermval3d() 메서드를 사용하십시오 -
print("\nResult...\n",H.hermval3d([1,2],[1,2],[1,2],c)) 예시
import numpy as np
from numpy.polynomial import hermite as H
# Create a 4d array of coefficients
c = np.arange(48).reshape(2,2,6,2)
# Display the array
print("Our Array...\n",c)
# Check the Dimensions
print("\nDimensions of our Array...\n",c.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n",c.dtype)
# Get the Shape
print("\nShape of our Array object...\n",c.shape)
# To evaluate a 3D Hermite series at points (x, y, z), use the hermite.hermval3d() method in Python Numpy
# The method returns the values of the multidimensional polynomial on points formed with triples of corresponding values from x, y, and z.
print("\nResult...\n",H.hermval3d([1,2],[1,2],[1,2],c)) 출력
Our Array...
[[[[ 0 1]
[ 2 3]
[ 4 5]
[ 6 7]
[ 8 9]
[10 11]]
[[12 13]
[14 15]
[16 17]
[18 19]
[20 21]
[22 23]]]
[[[24 25]
[26 27]
[28 29]
[30 31]
[32 33]
[34 35]]
[[36 37]
[38 39]
[40 41]
[42 43]
[44 45]
[46 47]]]]
Dimensions of our Array...
4
Datatype of our Array object...
int64
Shape of our Array object...
(2, 2, 6, 2)
Result...
[[ -8100. 104480.]
[ -8343. 107455.]]