File rot2.h¶
-
namespace sym
-
-
template<typename ScalarType>
class Rot2 - #include <rot2.h>
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
-
using DataVec = Eigen::Matrix<Scalar, 2, 1>
-
using TangentVec = Eigen::Matrix<Scalar, 1, 1>
-
using SelfJacobian = Eigen::Matrix<Scalar, 1, 1>
-
using Vector2 = Eigen::Matrix<Scalar, 2, 1>
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()
-
inline const DataVec &Data() const
-
inline explicit Rot2(const Scalar angle)
-
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 void ToStorage(Scalar *const vec) const
-
inline Self Inverse() const
-
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
-
inline Self Interpolate(const Self b, const Scalar alpha, const Scalar epsilon = kDefaultEpsilon<Scalar>) const
-
inline bool operator==(const Rot2 &rhs) const
-
inline bool operator!=(const Rot2 &rhs) 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 Self Identity()
-
static inline constexpr int32_t TangentDim()
-
static inline Self FromTangent(const TangentVec &vec, const Scalar epsilon = kDefaultEpsilon<Scalar>)
-
using Scalar = ScalarType
-
template<typename ScalarType>