3D rotation class.
More...
#include <IMP/algebra/Rotation3D.h>
|
(Note that these are not member functions.)
|
Rotation3D | compose (const Rotation3D &a, const Rotation3D &b) |
|
std::pair< Vector3D, double > | get_axis_and_angle (const Rotation3D &rot) |
| Decompose a Rotation3D object into a rotation around an axis. More...
|
|
double | get_distance (const Rotation3D &r0, const Rotation3D &r1) |
| Return a distance between the two rotations. More...
|
|
Rotation3D | get_identity_rotation_3d () |
| Return a rotation that does not do anything. More...
|
|
Rotation3D | get_interpolated (const Rotation3D &a, const Rotation3D &b, double f) |
| Interpolate between two rotations. More...
|
|
Rotation3D | get_random_rotation_3d () |
| Pick a rotation at random from all possible rotations. More...
|
|
Rotation3D | get_random_rotation_3d (const Rotation3D ¢er, double distance) |
| Pick a rotation at random near the provided one. More...
|
|
Rotation3D | get_rotation_about_axis (const Vector3D &axis, double angle) |
| Generate a Rotation3D object from a rotation around an axis. More...
|
|
Rotation3D | get_rotation_from_matrix (double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) |
| Generate a Rotation3D object from a rotation matrix.
|
|
Rotation3D | get_rotation_from_vector4d (const VectorD< 4 > &v) |
| Compute a rotatation from an unnormalized quaternion. More...
|
|
Rotation3D | get_rotation_taking_first_to_second (const Vector3D &v1, const Vector3D &v2) |
| Create a rotation from the first vector to the second one.
|
|
|
There are many conventions for how to define Euler angles, based on choices of which of the x,y,z axis to use in what order and whether the rotation axis is in the body frame (and hence affected by previous rotations) or in in a fixed frame. See http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles for a general description.
- All Euler angles are specified in radians.
- The names are all
rotation_from_{fixed/body}_abc() where abc is the ordering of x,y,z.
|
Rotation3D | get_rotation_from_fixed_zxz (double phi, double theta, double psi) |
| Initialize a rotation from euler angles. More...
|
|
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
- Note
- This class is a geometric primitive. Also, this class is not not initialized by its default constructor.
Definition at line 46 of file Rotation3D.h.
IMP::algebra::Rotation3D::Rotation3D |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
c, |
|
|
double |
d |
|
) |
| |
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 191 of file Rotation3D.h.
The distance runs between 0 and 1. More precisely, the distance returned is distance between the two quaternion vectors properly normalized, divided by sqrt(2).
A vector with distance d from the unit vector represents a rotation of
\( \theta= \cos^{-1}\left(1-\sqrt{2}d\right)\)
Definition at line 241 of file Rotation3D.h.
It f ==0, return b, if f==1 return a.
Definition at line 509 of file Rotation3D.h.
This method generates a rotation that is within the provided distance of center.
- Parameters
-
- Note
- The cost of this operation increases as distance goes to 0.
- Parameters
-
[in] | axis | the rotation axis passes through (0,0,0) |
[in] | angle | the rotation angle in radians in the clockwise direction |
- Note
- http://en.wikipedia.org/wiki/Rotation_matrix
-
www.euclideanspace.com/maths/geometry/rotations/conversions/ angleToQuaternion/index.htm
Rotation3D get_rotation_from_fixed_zxz |
( |
double |
phi, |
|
|
double |
theta, |
|
|
double |
psi |
|
) |
| |
|
related |
- Parameters
-
[in] | phi | Rotation around the Z axis in radians |
[in] | theta | Rotation around the X axis in radians |
[in] | psi | Rotation around the Z axis in radians |
- Note
- The first rotation is by an angle phi about the z-axis. The second rotation is by an angle theta in [0,pi] about the former x-axis , and the third rotation is by an angle psi about the former z-axis.
The documentation for this class was generated from the following file: