From 8aad6443bdb5bee4749f35c08ccf52217a8cb6b0 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Wed, 14 Jul 2010 21:04:04 +0000 Subject: [PATCH] Small utility function for Rot2 to return degrees --- geometry/Rot2.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/geometry/Rot2.h b/geometry/Rot2.h index dbc4a12d7..1d77ce49c 100644 --- a/geometry/Rot2.h +++ b/geometry/Rot2.h @@ -54,9 +54,15 @@ namespace gtsam { /** Named constructor that behaves as atan2, i.e., y,x order (!) and normalizes */ static Rot2 atan2(double y, double x); - /** return angle */ + /** return angle (RADIANS) */ double theta() const { return ::atan2(s_,c_); } + /** return angle (DEGREES) */ + double degrees() const { + const double degree = M_PI / 180; + return theta() / degree; + } + /** return cos */ inline double c() const { return c_; }