Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends
clipper::Rotation Class Reference

Rotation class. More...

#include <rotation.h>

List of all members.

Public Types

enum  EULERtype {
  EulerXYZr, EulerXYZs, EulerXYXr, EulerXYXs,
  EulerXZXr, EulerXZXs, EulerXZYr, EulerXZYs,
  EulerYZXr, EulerYZXs, EulerYZYr, EulerYZYs,
  EulerYXYr, EulerYXYs, EulerYXZr, EulerYXZs,
  EulerZXYr, EulerZXYs, EulerZXZr, EulerZXZs,
  EulerZYZr, EulerZYZs, EulerZYXr, EulerZYXs
 Enumeration of Euler conventions.

Public Member Functions

 Rotation ()
 null constructor
template<int T>
 Rotation (const Euler< T > &euler)
 constructor: from generic Euler
 Rotation (const Euler_ccp4 &euler)
 constructor: from Euler_ccp4
 Rotation (const Polar_ccp4 &polar)
 constructor: from Polar_ccp4
 Rotation (const Mat33<> &matrix)
 constructor: from Matrix
 Rotation (const ftype &w, const ftype &x, const ftype &y, const ftype &z)
 constructor: from components
const ftypew () const
 return w component
const ftypex () const
 return x component
const ftypey () const
 return y component
const ftypez () const
 return z component
template<int T>
Euler< T > euler () const
 < return Euler angles
Euler_ccp4 euler_ccp4 () const
 return Euler_ccp4 angles
Polar_ccp4 polar_ccp4 () const
 return Polar_ccp4 angles
Mat33 matrix () const
 return 3x3 matrix
const Rotationnorm ()
 normalise this quaternion
ftype abs_angle () const
 return absolute rotation angle
Rotation inverse () const
 return inverse rotation
bool is_null () const
 test for null (uninitialised) rotation
String format () const
 return formatted String representation

Static Public Member Functions

static Rotation zero ()
 return zero rotation
static Rotation null ()
 return null rotation

Protected Attributes

ftype w_
ftype x_
ftype y_
ftype z_


Rotation operator* (const Rotation &r1, const Rotation &r2)
 combine two rotations

Detailed Description

Rotation class.

This class represents a rotation. The internal representation is as a unit quaternion, which is easily combined, inverted, or converted to or from other commonly used forms.

Member Function Documentation

Euler_ccp4 clipper::Rotation::euler_ccp4 ( ) const

return Euler_ccp4 angles

If beta ~= 0, then alpha is set to zero.

The Euler_ccp4 angles.
Polar_ccp4 clipper::Rotation::polar_ccp4 ( ) const

return Polar_ccp4 angles

If omega ~= 0, then phi is set to zero.

The Polar_ccp4 angles.

Referenced by clipper::RTop_orth::axis_coordinate_near(), and clipper::Test_core::operator()().

Mat33 clipper::Rotation::matrix ( ) const

return 3x3 matrix

The resulting rotation matrix would commonly be used to construct a clipper::RTop_orth.

The rotation matrix.

Referenced by clipper::Test_core::operator()(), and clipper::RTop_orth::RTop_orth().

const Rotation & clipper::Rotation::norm ( )

normalise this quaternion

The normalisation is performed in-place. If a rotation becomes significantly denormalised, the conversion methods will fail. Therefore it may be safer to call this before a conversion.

Referenced by clipper::RTop_orth::axis_coordinate_near(), and clipper::RTop_orth::RTop_orth().

ftype clipper::Rotation::abs_angle ( ) const

return absolute rotation angle

Positive magnitude of the angle of rotation.

The angle in radians.

References clipper::Util::min().

Referenced by clipper::RTop_orth::axis_coordinate_near(), and clipper::RTop_orth::screw_translation().

Friends And Related Function Documentation

Rotation operator* ( const Rotation r1,
const Rotation r2 
) [friend]

combine two rotations

Note: This multiplication operator combines rotations in left-to-right order, rather than the right-to-left order used for matrices. Thus, the rotation which arises from applying rotation r1 followed by rotation r2 is given by r1*r2. Similarly, the rotation which arises from applying rotation r1 followed by rotation r2 and rotation r3 is given by (r1*r2)*r3.

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