8 #ifndef IMPALGEBRA_ROTATION_2D_H
9 #define IMPALGEBRA_ROTATION_2D_H
11 #include <IMP/algebra/algebra_config.h>
17 #include <boost/random/uniform_01.hpp>
21 IMPALGEBRA_BEGIN_NAMESPACE
23 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
25 Rotation2D
compose(
const Rotation2D &a,
const Rotation2D &b);
38 Rotation2D() : angle_(std::numeric_limits<double>::quiet_NaN()) {};
49 "Attempting to use uninitialized rotation");
50 return get_rotated(o[0], o[1]);
56 "Attempting to use uninitialized rotation");
57 return Vector2D(c_ * x - s_ * y, s_ * x + c_ * y);
63 "Attempting to use uninitialized rotation");
116 IMPALGEBRA_END_NAMESPACE
Rotation2D get_inverse() const
Returns the matrix for the inverse rotation.
Stores a 2D rotation matrix.
Rotation2D compose(const Rotation2D &a, const Rotation2D &b)
compose two rotations a and b
static const double PI
the constant pi
RandomNumberGenerator random_number_generator
A shared random number generator.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Random number generators used by IMP.
Functions to deal with very common math operations.
Rotation2D get_identity_rotation_2d()
Builds an identity rotation in 2D.
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
Vector2D get_rotated(const Vector2D &o) const
rotates a 2D point
Rotation2D get_rotation_to_x_axis(const Vector2D &v)
Various useful constants.
double get_angle() const
gets the angle
void set_angle(double angle)
sets the angle for the rotation
bool isnan(const T &a)
Return true if a number is NaN.
Rotation2D(double angle)
Builds the matrix for the given angle.
Vector2D get_rotated(const double x, const double y) const
rotates a 2D point
Rotation2D get_random_rotation_2d()
Builds an identity rotation in 2D.