TensorFlow 2.0 RC is available Learn more

tfg.geometry.transformation.axis_angle.rotate

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

tfg.geometry.transformation.axis_angle.rotate(
    point,
    axis,
    angle,
    name=None
)

Defined in geometry/transformation/axis_angle.py.

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.

Args:

  • 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".

Returns:

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

Raises:

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