Answers for "rotation points space python"

1

rotation points space python

'''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
Posted by: Guest on January-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language