Class sym::Rot2¶
-
template<typename ScalarType>
class Rot2¶ Autogenerated C++ implementation of
symforce.geo.rot2.Rot2
.Group of two-dimensional orthogonal matrices with determinant
+1
, representing rotations in 2D space. Backed by a complex number.Public Types
-
using Scalar = ScalarType¶
Public Functions
-
inline explicit Rot2(const DataVec &data, const bool normalize = true)¶
Construct from data vec
- Parameters:
normalize – Project to the manifold on construction. This ensures numerical stability as this constructor is called after each codegen operation. Constructing from a normalized vector may be faster, e.g. with
FromStorage
.
-
inline Rot2()¶
-
const Vector2 ComposeWithPoint(const Vector2 &right) const¶
Left-multiplication. Either rotation concatenation or point transform.
-
const Eigen::Matrix<Scalar, 2, 2> ToRotationMatrix() const¶
A matrix representation of this element in the Euclidean space that contains it.
-
inline Self InverseWithJacobian(SelfJacobian *const res_D_a = nullptr) const¶
-
inline Self ComposeWithJacobians(const Self &b, SelfJacobian *const res_D_a = nullptr, SelfJacobian *const res_D_b = nullptr) const¶
-
inline Self BetweenWithJacobians(const Self &b, SelfJacobian *const res_D_a = nullptr, SelfJacobian *const res_D_b = nullptr) const¶
-
inline TangentVec ToTangent(const Scalar epsilon = kDefaultEpsilon<Scalar>) const¶
-
inline Self Retract(const TangentVec &vec, const Scalar epsilon = kDefaultEpsilon<Scalar>) const¶
-
inline TangentVec LocalCoordinates(const Self &b, const Scalar epsilon = kDefaultEpsilon<Scalar>) const¶
Public Static Functions
-
static const sym::Rot2<Scalar> FromAngle(const Scalar theta)¶
Create a Rot2 from an angle
theta
in radiansThis is equivalent to
from_tangent([theta])
-
static const sym::Rot2<Scalar> FromRotationMatrix(const Eigen::Matrix<Scalar, 2, 2> &r)¶
Create a Rot2 from a 2x2 rotation matrix.
Returns the closest Rot2 to the input matrix, by the Frobenius norm. Will be singular when
r[0, 0] == -r[1, 1]
andr[0, 1] == r[1, 0]
are both true.See notebooks/rot2_from_rotation_matrix_derivation.ipynb for the derivation.
-
static const sym::Rot2<Scalar> RandomFromUniformSample(const Scalar u1)¶
Generate a random element of SO2 from a variable uniformly sampled on [0, 1].
-
static inline constexpr int32_t StorageDim()¶
-
static inline constexpr int32_t TangentDim()¶
-
static inline Self FromTangent(const TangentVec &vec, const Scalar epsilon = kDefaultEpsilon<Scalar>)¶
-
using Scalar = ScalarType¶