Small utility function for Rot2 to return degrees

release/4.3a0
Alex Cunningham 2010-07-14 21:04:04 +00:00
parent 3245bad2aa
commit 8aad6443bd
1 changed files with 7 additions and 1 deletions

View File

@ -54,9 +54,15 @@ namespace gtsam {
/** Named constructor that behaves as atan2, i.e., y,x order (!) and normalizes */ /** Named constructor that behaves as atan2, i.e., y,x order (!) and normalizes */
static Rot2 atan2(double y, double x); static Rot2 atan2(double y, double x);
/** return angle */ /** return angle (RADIANS) */
double theta() const { return ::atan2(s_,c_); } double theta() const { return ::atan2(s_,c_); }
/** return angle (DEGREES) */
double degrees() const {
const double degree = M_PI / 180;
return theta() / degree;
}
/** return cos */ /** return cos */
inline double c() const { return c_; } inline double c() const { return c_; }