From 2bd7a1c51376be178699e5abbb91bf6918d9da59 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Thu, 8 Jul 2010 14:39:06 +0000 Subject: [PATCH] Added another constructor and more comments regarding degrees/radians to Rot2 --- cpp/Rot2.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cpp/Rot2.h b/cpp/Rot2.h index 321fc2bdc..dbc4a12d7 100644 --- a/cpp/Rot2.h +++ b/cpp/Rot2.h @@ -16,7 +16,9 @@ namespace gtsam { - /* Rotation matrix */ + /** Rotation matrix + * NOTE: the angle theta is in radians unless explicitly stated + */ class Rot2: Testable, public Lie { private: @@ -37,9 +39,15 @@ namespace gtsam { /** "named constructors" */ - /** Named constructor from angle == exponential map at identity */ + /** Named constructor from angle == exponential map at identity - theta is in radians*/ static Rot2 fromAngle(double theta); + /** Named constructor from angle in degrees */ + static Rot2 fromDegrees(double theta) { + const double degree = M_PI / 180; + return fromAngle(theta * degree); + } + /** Named constructor from cos(theta),sin(theta) pair, will *not* normalize! */ static Rot2 fromCosSin(double c, double s);