44 inline Rot2(
double c,
double s) : c_(c), s_(s) {}
52 Rot2() : c_(1.0), s_(0.0) {}
58 Rot2(
double theta) : c_(cos(theta)), s_(sin(theta)) {}
67 static const double degree = M_PI / 180;
68 return fromAngle(theta * degree);
72 static Rot2 fromCosSin(
double c,
double s);
85 static Rot2 atan2(
double y,
double x);
93 static Rot2 Random(std::mt19937 & rng);
100 void print(
const std::string& s =
"theta")
const;
103 bool equals(
const Rot2& R,
double tol = 1e-9)
const;
117 return fromCosSin(c_ * R.c_ - s_ * R.s_, s_ * R.c_ + c_ * R.s_);
187 return ::atan2(s_, c_);
192 const double degree = M_PI / 180;
193 return theta() / degree;
197 inline double c()
const {
202 inline double s()
const {
207 Matrix2 matrix()
const;
210 Matrix2 transpose()
const;
213 static Rot2 ClosestTo(
const Matrix2& M);
216 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 218 friend class boost::serialization::access;
219 template<
class ARCHIVE>
220 void serialize(ARCHIVE & ar,
const unsigned int ) {
221 ar & BOOST_SERIALIZATION_NVP(c_);
222 ar & BOOST_SERIALIZATION_NVP(s_);
double degrees() const
Definition: Rot2.h:191
double c() const
Definition: Rot2.h:197
static Matrix ExpmapDerivative(const Vector &)
Left-trivialized derivative of the exponential map.
Definition: Rot2.h:134
GTSAM_EXPORT Point3 normalize(const Point3 &p, OptionalJacobian< 3, 3 > H={})
normalize, with optional Jacobian
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:113
Vector2 Point2
Definition: Point2.h:32
Point2 unit() const
Creates a unit vector as a Point2.
Definition: Rot2.h:181
Rot2 operator*(const Rot2 &R) const
Definition: Rot2.h:116
Rot2(const Rot2 &r)
Definition: Rot2.h:55
static Matrix LogmapDerivative(const Vector &)
Left-trivialized derivative inverse of the exponential map.
Definition: Rot2.h:139
static Rot2 fromDegrees(double theta)
Named constructor from angle in degrees.
Definition: Rot2.h:66
double s() const
Definition: Rot2.h:202
Definition: Testable.h:112
Point2 operator*(const Point2 &p) const
Definition: Rot2.h:166
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
static Rot2 Identity()
Definition: Rot2.h:110
Base class and basic functions for Lie types.
Definition: chartTesting.h:28
Definition: OptionalJacobian.h:38
Rot2()
Definition: Rot2.h:52
Both LieGroupTraits and Testable.
Definition: Lie.h:229
Rot2 inverse() const
Definition: Rot2.h:113
Matrix1 AdjointMap() const
Definition: Rot2.h:131
static Rot2 fromAngle(double theta)
Named constructor from angle in radians.
Definition: Rot2.h:61
Rot2(double theta)
Constructor from angle in radians == exponential map at identity.
Definition: Rot2.h:58
double theta() const
Definition: Rot2.h:186