tfg.geometry.transformation.axis_angle.rotate

View source on GitHub

Rotates a 3d point using an axis-angle by applying the Rodrigues' formula.

Rotates a vector

$$\mathbf{v} \in {\mathbb{R}^3}$$

into a vector

$$\mathbf{v}' \in {\mathbb{R}^3}$$

using the Rodrigues' rotation formula:

$$\mathbf{v}'=\mathbf{v}\cos(\theta)+(\mathbf{a}\times\mathbf{v})\sin(\theta) +\mathbf{a}(\mathbf{a}\cdot\mathbf{v})(1-\cos(\theta)).$$

Note:

In the following, A1 to An are optional batch dimensions.

point A tensor of shape [A1, ..., An, 3], where the last dimension represents a 3d point to rotate.
axis A tensor of shape [A1, ..., An, 3], where the last dimension represents a normalized axis.
angle A tensor of shape [A1, ..., An, 1], where the last dimension represents an angle.
name A name for this op that defaults to "axis_angle_rotate".

A tensor of shape [A1, ..., An, 3], where the last dimension represents a 3d point.

ValueError If point, axis, or angle are of different shape or if their respective shape is not supported.