Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

ประเมินอนุกรม Laguerre 3 มิติ ที่จุด (x,y,z) ใน Python

บทนำ

เมธอด laguerre.lagval3d() ประเมินอนุกรม Laguerre 3 มิติ ที่จุด (x, y, z) ด้วยสัมประสิทธิ์ 3 มิติ

ตัวอย่าง: สัมประสิทธิ์ 3 มิติ (2,2,6)

import numpy as np
from numpy.polynomial import laguerre as L

c = np.arange(24).reshape(2, 2, 6)
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.lagval3d([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]]]
Dimensions of our Array... 3
Datatype of our Array object... int64
Shape of our Array object... (2, 2, 6)
Result... [-7.83333333  0.        ]

ผลลัพธ์เป็นเวกเตอร์ 2 องค์ประกอบ ตรงกับรูปร่างของจุด x, y, z