skrobot.coordinates.geo.rotate_points¶
- skrobot.coordinates.geo.rotate_points(points, a, b)[source]¶
Rotate given points based on a starting and ending vector.
Axis vector k is calculated from the any two nonzero vectors a and b. Rotated points are calculated from following Rodrigues rotation formula.
\[`P_{rot} = P \cos \theta + (k \times P) \sin \theta + k (k \cdot P) (1 - \cos \theta)`\]- Parameters:
points (numpy.ndarray) – Input points. The shape should be (3, ) or (N, 3).
a (numpy.ndarray) – nonzero vector.
b (numpy.ndarray) – nonzero vector.
- Returns:
points_rot – rotated points.
- Return type: