Write a NumPy program to compute the cross product of two given vectors
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
p = [[1, 0], [0, 1]]
q = [[1, 2], [3, 4]]
print("original matrix:")
print(p)
print(q)
result1 = np.cross(p, q)
result2 = np.cross(q, p)
print("cross product of the said two vectors(p, q):")
print(result1)
print("cross product of the said two vectors(q, p):")
print(result2)
Sample Output:
original matrix: [[1, 0], [0, 1]] [[1, 2], [3, 4]] cross product of the said two vectors(p, q): [ 2 -3] cross product of the said two vectors(q, p): [-2 3]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال