บทนำ
เมธอด legendre.leggrid3d() ประเมินอนุกรม Legendre 3 มิติ ที่ผลคูณการ์ทีเซียนของ x, y, z ด้วยสัมประสิทธิ์ 2 มิติ
ตัวอย่าง: สัมประสิทธิ์ 2 มิติ (2,2)
import numpy as np
from numpy.polynomial import legendre as L
c = np.arange(4).reshape(2, 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)
print("\nResult...\n", L.leggrid3d([1, 2], [1, 2], [1, 2], c))
ผลลัพธ์
Our Array... [[0 1]
[2 3]]
Dimensions of our Array... 2
Datatype of our Array object... int64
Shape of our Array object... (2, 2)
Result... [[17. 28.]
[28. 46.]]
สัมประสิทธิ์ 2D ถูกขยายเป็น 3D อัตโนมัติ ผลลัพธ์ 2x2 จาก Cartesian product ของ [1,2]³