📜  旋转点空间python代码示例

📅  最后修改于: 2022-03-11 14:46:51.453000             🧑  作者: Mango

代码示例1
'''A simple example: 3D rotation of points (reference frame: [0,0,0],[x,y,z])'''
import numpy as np
from scipy.spatial.transform import Rotation as R
p=np.random.rand(20,3) #Generate a random 3D point cloud
#10° rotation in each principal direction:
r = R.from_euler('xyz',(10,10,10), degrees=True) 
p_r=r.apply(p) #Rotated points