holoscan::SO2
holoscan::SO2
Class representing 2D rotations using the SO(2) group.
This class represents rotations in 2D space as elements of the special orthogonal group SO(2). Internally, rotations are stored as normalized direction vectors (cos, sin) to avoid trigonometric function calls during composition and transformation operations.
Template parameters
Scalar type (typically float or double).
Constructors
SO2
Default constructor creates an undefined rotation.
Use identity() to create the identity rotation.
Methods
cos
Get the cosine of the rotation angle.
This is a simple getter and does not call trigonometric functions.
Returns: Cosine of the rotation angle.
sin
Get the sine of the rotation angle.
This is a simple getter and does not call trigonometric functions.
Returns: Sine of the rotation angle.
as_direction
Get the cos and sin of the rotation angle as a direction vector.
Returns: Direction vector (cos, sin).
angle
Get the rotation angle in range [-π, π].
This uses a call to a trigonometric function.
Returns: Rotation angle in radians.
matrix
Get the 2×2 rotation matrix representation.
Returns: 2×2 rotation matrix.
inverse
Get the inverse rotation.
Returns: Inverse rotation.
cast
Const (1)
Const (2)
Cast to a different scalar type.
Returns: Rotation cast to the target type.
Template parameters
Target scalar type.
Static methods
identity
Create the identity rotation.
Returns: Identity rotation (no rotation).
from_angle
Create rotation from an angle.
This uses calls to trigonometric functions.
Returns: Rotation representing the given angle.
Parameters
Rotation angle in radians.
from_direction
Overload 1
Create rotation from direction components
Create rotation from a not necessarily normalized direction vector.
Returns: Rotation aligned with the given direction.
Parameters
Direction vector (will be normalized internally).
from_normalized
Overload 1
Create rotation from normalized cos and sin values
Create rotation from a normalized cos/sin direction vector.
Returns: Rotation represented by the given cos/sin values.
Parameters
Normalized direction vector (cos, sin).