pub struct SO2 { /* private fields */ }Expand description
SO(2) group element representing rotations in 2D.
Stored as a single angle θ (radians). UnitComplex is derived on demand for math operations, keeping storage minimal and contiguous.
Implementations§
Source§impl SO2
impl SO2
Sourcepub const DIM: usize = 2
pub const DIM: usize = 2
Space dimension - dimension of the ambient space that the group acts on
Sourcepub fn jacobian_identity() -> Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>
pub fn jacobian_identity() -> Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>
Get the identity matrix for Jacobians.
Sourcepub fn new(complex: Unit<Complex<f64>>) -> SO2
pub fn new(complex: Unit<Complex<f64>>) -> SO2
Create a new SO(2) element from a unit complex number.
Sourcepub fn from_angle(angle: f64) -> SO2
pub fn from_angle(angle: f64) -> SO2
Create SO(2) from an angle.
Sourcepub fn rotation_matrix(
&self,
) -> Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
pub fn rotation_matrix( &self, ) -> Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
Get the rotation matrix (2x2).
Trait Implementations§
Source§impl LieGroup for SO2
impl LieGroup for SO2
Source§fn inverse(
&self,
jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>,
) -> SO2
fn inverse( &self, jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>, ) -> SO2
SO2 inverse: R(θ)⁻¹ = R(-θ).
Source§fn compose(
&self,
other: &SO2,
jacobian_self: Option<&mut <SO2 as LieGroup>::JacobianMatrix>,
jacobian_other: Option<&mut <SO2 as LieGroup>::JacobianMatrix>,
) -> SO2
fn compose( &self, other: &SO2, jacobian_self: Option<&mut <SO2 as LieGroup>::JacobianMatrix>, jacobian_other: Option<&mut <SO2 as LieGroup>::JacobianMatrix>, ) -> SO2
SO2 composition: angles add, wrapped via UnitComplex to stay in [-π, π].
Source§fn log(
&self,
jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>,
) -> <SO2 as LieGroup>::TangentVector
fn log( &self, jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>, ) -> <SO2 as LieGroup>::TangentVector
Logarithmic map: returns the canonical angle in [-π, π].
Source§fn act(
&self,
vector: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
_jacobian_self: Option<&mut <SO2 as LieGroup>::JacobianMatrix>,
_jacobian_vector: Option<&mut Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>>,
) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
fn act( &self, vector: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, _jacobian_self: Option<&mut <SO2 as LieGroup>::JacobianMatrix>, _jacobian_vector: Option<&mut Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>>, ) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
Rotation action on a 3-vector (operates on the xy-plane).
Source§fn adjoint(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn adjoint(&self) -> <SO2 as LieGroup>::JacobianMatrix
Adjoint for SO(2) is identity (abelian group).
Source§type TangentVector = SO2Tangent
type TangentVector = SO2Tangent
Source§type JacobianMatrix = Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>
type JacobianMatrix = Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>
Source§type LieAlgebra = Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
type LieAlgebra = Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
Source§fn jacobian_identity() -> <SO2 as LieGroup>::JacobianMatrix
fn jacobian_identity() -> <SO2 as LieGroup>::JacobianMatrix
Source§fn zero_jacobian() -> <SO2 as LieGroup>::JacobianMatrix
fn zero_jacobian() -> <SO2 as LieGroup>::JacobianMatrix
Source§fn is_approx(&self, other: &SO2, tolerance: f64) -> bool
fn is_approx(&self, other: &SO2, tolerance: f64) -> bool
Source§fn as_param_slice(&self) -> &[f64]
fn as_param_slice(&self) -> &[f64]
Source§fn as_param_slice_mut(&mut self) -> &mut [f64]
fn as_param_slice_mut(&mut self) -> &mut [f64]
Source§fn from_param_slice(s: &[f64]) -> SO2
fn from_param_slice(s: &[f64]) -> SO2
as_param_slice).Source§fn right_plus(
&self,
tangent: &Self::TangentVector,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
) -> Self
fn right_plus( &self, tangent: &Self::TangentVector, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_tangent: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn right_minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn right_minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn left_plus(
&self,
tangent: &Self::TangentVector,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
jacobian_self: Option<&mut Self::JacobianMatrix>,
) -> Self
fn left_plus( &self, tangent: &Self::TangentVector, jacobian_tangent: Option<&mut Self::JacobianMatrix>, jacobian_self: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn left_minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn left_minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn plus(
&self,
tangent: &Self::TangentVector,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
) -> Self
fn plus( &self, tangent: &Self::TangentVector, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_tangent: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn between(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self
fn between( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn tangent_dim(&self) -> usize
fn tangent_dim(&self) -> usize
impl StructuralPartialEq for SO2
Source§impl Tangent<SO2> for SO2Tangent
impl Tangent<SO2> for SO2Tangent
Source§fn exp(&self, jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>) -> SO2
fn exp(&self, jacobian: Option<&mut <SO2 as LieGroup>::JacobianMatrix>) -> SO2
SO2 exponential map.
§Arguments
tangent- Tangent vector (angle)jacobian- Optional Jacobian matrix of the SE(3) element wrt this.
Source§fn right_jacobian(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn right_jacobian(&self) -> <SO2 as LieGroup>::JacobianMatrix
Right Jacobian for SO(2) is identity.
Source§fn left_jacobian(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn left_jacobian(&self) -> <SO2 as LieGroup>::JacobianMatrix
Left Jacobian for SO(2) is identity.
Source§fn right_jacobian_inv(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn right_jacobian_inv(&self) -> <SO2 as LieGroup>::JacobianMatrix
Inverse of right Jacobian for SO(2) is identity.
Source§fn left_jacobian_inv(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn left_jacobian_inv(&self) -> <SO2 as LieGroup>::JacobianMatrix
Inverse of left Jacobian for SO(2) is identity.
Source§fn hat(&self) -> <SO2 as LieGroup>::LieAlgebra
fn hat(&self) -> <SO2 as LieGroup>::LieAlgebra
Hat operator: θ^∧ (scalar to skew-symmetric matrix).
Source§fn zero() -> SO2Tangent
fn zero() -> SO2Tangent
Zero tangent vector for SO2
Source§fn random() -> SO2Tangent
fn random() -> SO2Tangent
Random tangent vector for SO2
Source§fn normalized(&self) -> SO2Tangent
fn normalized(&self) -> SO2Tangent
Return a unit tangent vector in the same direction.
Source§fn small_adj(&self) -> <SO2 as LieGroup>::JacobianMatrix
fn small_adj(&self) -> <SO2 as LieGroup>::JacobianMatrix
Small adjoint matrix for SO(2).
For SO(2), the small adjoint is zero (since it’s commutative).
Source§fn lie_bracket(&self, _other: &SO2Tangent) -> <SO2 as LieGroup>::TangentVector
fn lie_bracket(&self, _other: &SO2Tangent) -> <SO2 as LieGroup>::TangentVector
Lie bracket for SO(2).
For SO(2), the Lie bracket is always zero since it’s commutative.
Source§fn is_approx(&self, other: &SO2Tangent, tolerance: f64) -> bool
fn is_approx(&self, other: &SO2Tangent, tolerance: f64) -> bool
Check if this tangent vector is approximately equal to another.
§Arguments
other- The other tangent vector to compare withtolerance- The tolerance for the comparison
Source§fn from_slice(s: &[f64]) -> SO2Tangent
fn from_slice(s: &[f64]) -> SO2Tangent
as_slice).Source§fn is_dynamic() -> bool
fn is_dynamic() -> bool
Auto Trait Implementations§
impl Freeze for SO2
impl RefUnwindSafe for SO2
impl Send for SO2
impl Sync for SO2
impl Unpin for SO2
impl UnsafeUnpin for SO2
impl UnwindSafe for SO2
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> ErrorLogging for Twhere
T: Display,
impl<T> ErrorLogging for Twhere
T: Display,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.