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:
Returns:

points_rot – rotated points.

Return type:

numpy.ndarray