23 #include <boost/optional.hpp> 42 inline Rot2(
double c,
double s) : c_(c), s_(s) {}
50 Rot2() : c_(1.0), s_(0.0) {}
53 Rot2(
double theta) : c_(cos(theta)), s_(sin(theta)) {}
62 const double degree = M_PI / 180;
63 return fromAngle(theta * degree);
67 static Rot2 fromCosSin(
double c,
double s);
80 static Rot2 atan2(
double y,
double x);
87 void print(
const std::string& s =
"theta")
const;
90 bool equals(
const Rot2& R,
double tol = 1e-9)
const;
104 return fromCosSin(c_ * R.c_ - s_ * R.s_, s_ * R.c_ + c_ * R.s_);
174 return ::atan2(s_, c_);
179 const double degree = M_PI / 180;
180 return theta() / degree;
184 inline double c()
const {
189 inline double s()
const {
194 Matrix2 matrix()
const;
197 Matrix2 transpose()
const;
201 friend class boost::serialization::access;
202 template<
class ARCHIVE>
203 void serialize(ARCHIVE & ar,
const unsigned int ) {
204 ar & BOOST_SERIALIZATION_NVP(c_);
205 ar & BOOST_SERIALIZATION_NVP(s_);
Rot2 operator*(const Rot2 &R) const
Compose - make a new rotation by adding angles.
Definition: Rot2.h:103
Base class and basic functions for Lie types.
Point3 normalize(const Point3 &p, OptionalJacobian< 3, 3 > H)
normalize, with optional Jacobian
Definition: Point3.cpp:108
static Rot2 identity()
identity
Definition: Rot2.h:97
double degrees() const
return angle (DEGREES)
Definition: Rot2.h:178
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:140
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Point2 unit() const
Creates a unit vector as a Point2.
Definition: Rot2.h:168
A CRTP helper class that implements Lie group methods Prerequisites: methods operator*, inverse, and AdjointMap, as well as a ChartAtOrigin struct that will be used to define the manifold Chart To use, simply derive, but also say "using LieGroup<Class,N>::inverse" For derivative math, see doc/math.pdf.
Definition: Lie.h:36
double c() const
return cos
Definition: Rot2.h:184
static Matrix ExpmapDerivative(const Vector &)
Left-trivialized derivative of the exponential map.
Definition: Rot2.h:121
Template to create a binary predicate.
Definition: Testable.h:110
Rot2 inverse() const
The inverse rotation - negative angle.
Definition: Rot2.h:100
double s() const
return sin
Definition: Rot2.h:189
static Rot2 fromDegrees(double theta)
Named constructor from angle in degrees.
Definition: Rot2.h:61
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Rot2(double theta)
Constructor from angle in radians == exponential map at identity.
Definition: Rot2.h:53
double theta() const
return angle (RADIANS)
Definition: Rot2.h:173
Rot2()
default constructor, zero rotation
Definition: Rot2.h:50
static Matrix LogmapDerivative(const Vector &)
Left-trivialized derivative inverse of the exponential map.
Definition: Rot2.h:126
Point2 operator*(const Point2 &p) const
syntactic sugar for rotate
Definition: Rot2.h:153
Matrix1 AdjointMap() const
Calculate Adjoint map.
Definition: Rot2.h:118
static Rot2 fromAngle(double theta)
Named constructor from angle in radians.
Definition: Rot2.h:56
Both LieGroupTraits and Testable.
Definition: Lie.h:237
Global functions in a separate testing namespace.
Definition: chartTesting.h:28