三维点云学习(8)6-3D Feature Description numpy 向量点乘、叉乘、星乘 ; 矩阵点乘、星乘辨析(易混淆)
向量运算
import numpy as np
#向量
a1 = np.asarray([1,1,1])
b1 = np.asarray([1,1,1])
向量点乘 np.dot
##向量内积 点乘 ,结果是实数
c1 = np.dot(a1,b1)
print(c1)
#out:
3
向量叉乘 np.cross
d1 = np.cross(a1,b1)
print(d1)
#out:
[0 0 0]
向量星乘
e1 = np.multiply(a1,b1)
print(e1)
#out:
[1 1 1]
g1 = a1*b1
print(g1)
#out:
[1 1 1]
矩阵运算
矩阵点乘np.dot
c2 = np.dot(a2,b2)
print(c2)
#out:
[[3 3 3]
[3 3 3]
[3 3 3]]
矩阵星乘
d2 = np.multiply(a2,b2)
print(d2)
#out:
[[1 1 1]
[1 1 1]
[1 1 1]]
e2 = a2*b2
print(e2)
#out:
[[1 1 1]
[1 1 1]
[1 1 1]]