পাইথন নামপাই-এ 3-ডি চেবিশেভ সিরিজকে পয়েন্ট (x, y, z)-এ মূল্যায়ন করতে polynomial.chebval3d() মেথড ব্যবহার করুন। এই মেথডটি x, y, এবং z-র থেকে megfelelমানের ট্রিপল দ্বারা গঠিত পয়েন্টগুলোর ওপর বহুমাত্রিক পলিনোমিয়ালের মান রিটার্ন করে।
প্যারামিটারস
- x, y, z: তিন-মাত্রিক সিরিজটি (x, y, z) পয়েন্টগুলোর ওপর মূল্যায়ন করা হয়, যেখানে x, y, এবং z-এর একই আকার থাকতে হবে। যদি x, y, বা z-এর যেকোনো একটি লিস্ট বা টাপল হয়, তবে সেটি প্রথমে ndarray-এ রূপান্তরিত হয়, অন্যথায় এটি অপরিবর্তিত থাকে এবং যদি এটি ndarray না হয় তবে এটিকে স্ক্যালার হিসেবে বিবেচনা করা হয়।
- c: সহগগুলোর একটি অ্যারে যাতে multidegree i,j,k-এর পদটির সহগ c[i,j,k]-তে থাকে। যদি c-এর মাত্রা ৩-এর বেশি হয়, তবে বাকি ইনডেক্সগুলো একাধিক সহগ সেট গণনা করে।
ধাপসমূহ
- প্রয়োজনীয় লাইব্রেরি ইম্পোর্ট করুন:
import numpy as np from numpy.polynomial import chebyshev as C - সহগগুলোর একটি 4D অ্যারে তৈরি করুন:
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) polynomial.chebval3d()মেথড ব্যবহার করে 3-ডি চেবিশেভ সিরিজ মূল্যায়ন করুন:print("\nResult...\n", C.chebval3d([1,2], [1,2], [1,2], c))
সম্পূর্ণ উদাহরণ
import numpy as np
from numpy.polynomial import chebyshev as C
# 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)
# Evaluate 3-D Chebyshev series at points (x, y, z)
print("\nResult...\n", C.chebval3d([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... [[ 552. 148176.]
[ 576. 152631.]]