R3::basic_rotation
namespace nin::R3 {
template <std::floating_point T>
class basic_rotation;
}
A 3D rotation stored as an axis-angle pair.
Unlike basic_orientation_qty,
a rotation can span multiple full turns.
The rotation matrix factors are cached and recomputed lazily when the axis or angle changes.
The invariant requires the axis vector to be non-zero; it is normalised internally before use.
Nested types
| Type | Definition |
|---|---|
|
|
|
|
|
|
Member functions
(Constructor)
constructs a 3D rotation
(Constructor)
constructs a 3D rotation
|
(1) |
|
(2) |
|
(3) |
|
(4) |
|
(5) |
-
(1) Default constructor. Identity rotation about X axis.
-
(2) Explicit converting constructor from a different floating-point type.
-
(3) Constructs from a rotation matrix with optional revolution count.
-
(4) Constructs from an axis (3-element container) and an angle. Throws
std::domain_errorif the axis is zero and the angle is non-zero. -
(5) Constructs the rotation that maps
referencetomeasure, plusrevolutionsfull turns.
invert
negates the rotation angle in place
invert
negates the rotation angle in place
|
(1) |
axis
rotation axis accessor
axis
rotation axis accessor
|
(1) |
Returns the rotation axis. The mutable overload is disabled to protect the
non-zero invariant; use set_axis() instead.
set_axis
replaces the rotation axis
set_axis
replaces the rotation axis
|
(1) |
Sets a new axis while preserving the current angle.
Throws std::domain_error if the axis is zero and the angle is non-zero.
angle
rotation angle accessor
angle
rotation angle accessor
|
(1) |
|
(2) |
-
(1) Returns the current angle.
-
(2) Returns a mutable reference. Modifying it invalidates the cache.
operator()
applies the rotation
operator()
applies the rotation
|
(1) |
|
(2) |
|
(3) |
-
(1) Rotates a 3-element container of raw scalars.
-
(2) Rotates an orientation quantity.
-
(3) Rotates a position quantity.
Non-member functions
inv
returns an inverted rotation
inv
returns an inverted rotation
|
(1) |
compose
composes two rotations
compose
composes two rotations
|
(1) |
The left rotation evaluates after the right rotation.
An optional revolutions parameter adds full turns to the result.