arim.geometry.rotate#
- arim.geometry.rotate(coords, rotation_matrix, centre=None)[source]#
Rotate these points given a rotation matrix and the centre.
The rotation of a point OM (in column) is given by OM’ such as:
OM’ := RotationMatrix x OM + Centre
This function accepts multiple rotations: for example to have one rotation matrix per point of index
idx
,rotation_matrix[idx]
must be a 3x3 matrix.- Parameters:
coords (ndarray) – Coordinates to rotate. Shape: (*shape_points, 3)
rotation_matrix – Shape: (3, 3) or (*shape_points, 3, 3). Rotation matrices to apply: either one for all points or one per point.
centre (ndarray, optional) – Centre of the rotation. This point is invariant by rotation. Shape: Shape: (3, 3) or (*shape_points, 3). Default: centre = (0., 0., 0.)
- Returns:
rotated_points – Shape: (*shape_points, 3
- Return type:
ndarray