tbplas.rotate_coord
- tbplas.rotate_coord(coord: ndarray, angle: float = 0.0, axis: str = 'z', center: ndarray = array([0., 0., 0.])) ndarray
Rotate Cartesian coordinates according to Euler angles.
Reference: https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
Note that the right-hand rule is used, i.e., a positive value means the angle is counter-clockwise.
- Parameters:
coord – (num_coord, 3) float64 array Cartesian coordinates to rotate
angle – float rotation angle in RADIAN, not degrees
axis – string axis around which the rotation is performed
center – (3,) float64 array Cartesian coordinate of rotation center
- Returns:
(num_coord, 3) float64 array rotated Cartesian coordinates
- Raises:
ValueError – if axis is not “x”, “y” or “z”