IMP  2.2.1
The Integrative Modeling Platform
IMP::algebra::Rotation3D Class Reference

3D rotation class. More...

#include <IMP/algebra/Rotation3D.h>

+ Inheritance diagram for IMP::algebra::Rotation3D:

Public Member Functions

 Rotation3D (const VectorD< 4 > &v, bool assume_normalized=false)
 
 Rotation3D ()
 Create an invalid rotation.
 
 Rotation3D (double a, double b, double c, double d)
 Create a rotation from a quaternion. More...
 
const Vector3D get_derivative (const Vector3D &o, unsigned int i) const
 Return the derivative of the position o with respect to the i'th internal quaternion coefficient, for i in [0..3], namely (dx/di, dy/di, dz/di) ??? TODO: is this even true ???
 
Rotation3D get_inverse () const
 Return the rotation which undoes this rotation.
 
const Vector4Dget_quaternion () const
 Return the quaternion so that it can be stored. More...
 
Vector3D get_rotated (const Vector3D &o) const
 Rotate a vector around the origin.
 
double get_rotated_one_coordinate (const Vector3D &o, unsigned int coord) const
 Gets only the requested rotation coordinate of the vector.
 
Vector3D get_rotation_matrix_row (int i) const
 
Vector3D operator* (const Vector3D &v) const
 Rotate a vector around the origin.
 
Rotation3D operator* (const Rotation3D &q) const
 multiply two rotations
 
Rotation3D operator/ (const Rotation3D &r) const
 Compute the rotation which when composed with r gives this.
 
const Rotation3Doperator/= (const Rotation3D &r)
 
void show (std::ostream &out=std::cout) const
 

Friends

Rotation3D compose (const Rotation3D &a, const Rotation3D &b)
 

Detailed Description

Rotations are currently represented using quaternions and a cached copy of the rotation matrix. The quaternion allows for fast and stable composition and the cached rotation matrix means that rotations are performed quickly. See http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation for a comparison of different implementations of rotations.

Currently the rotation can be initialized from either:

  • XYZ Euler angles
  • Rotation Matrix
  • Quaternion
  • angle/axis representation

See geometric primitives for more information.

Definition at line 46 of file Rotation3D.h.

Constructor & Destructor Documentation

IMP::algebra::Rotation3D::Rotation3D ( const VectorD< 4 > &  v,
bool  assume_normalized = false 
)
explicit

Create a rotation from a vector of 4 quaternion coefficients.

Note
: use assume_normalize with care - inputting an unnormalized vector would result in unexpected results if it is true

Definition at line 80 of file Rotation3D.h.

IMP::algebra::Rotation3D::Rotation3D ( double  a,
double  b,
double  c,
double  d 
)
Exceptions
base::ValueExceptionif the rotation is not a unit vector.

Definition at line 90 of file Rotation3D.h.

Member Function Documentation

const Vector4D& IMP::algebra::Rotation3D::get_quaternion ( ) const

Note that there is no guarantee on which of the two equivalent quaternions is returned.

Definition at line 192 of file Rotation3D.h.

Friends And Related Function Documentation

Rotation3D compose ( const Rotation3D a,
const Rotation3D b 
)
friend

See Rotation3D

Definition at line 348 of file Rotation3D.h.


The documentation for this class was generated from the following file: