我想沿z轴旋转矢量:
#!/usr/bin/env python
import numpy as np
theta = np.radians(90)
c, s = np.cos(theta), np.sin(theta)
R = np.matrix([[c, -s, 0], [s, c,0], [0,0,1]])
v = np.matrix( [ 0. , 1.83124623, -0.52249415] )
print R*v.reshape(3,1)
我得到了回报:
[[ -1.83124623e+00]
[ 1.12131492e-16]
[ -5.22494150e-01]]