Classes | |
| struct | axis_and_angle_from_matrix |
| Numerically robust computation of rotation axis and angle. More... | |
Functions | |
| template<typename FloatType> | |
| mat3< FloatType > | axis_and_angle_as_matrix (vec3< FloatType > const &axis, FloatType angle, bool deg=false, FloatType const &min_axis_length=1.e-15) |
| Conversion of axis and angle to a rotation matrix. | |
| template<typename FloatType> | |
| af::tiny< FloatType, 4 > | normalized_axis_and_angle_rad_as_unit_quaternion (const FloatType *axis, FloatType const &angle) |
| Conversion without validation of inputs. | |
| template<typename FloatType> | |
| af::tiny< FloatType, 4 > | axis_and_angle_as_unit_quaternion (vec3< FloatType > const &axis, FloatType angle, bool deg=false, FloatType const &min_axis_length=1.e-15) |
| Conversion with validation of inputs. | |
| template<typename FloatType> | |
| mat3< FloatType > | vector_to_vector (vec3< FloatType > const &given_unit_vector, vec3< FloatType > const &target_unit_vector, FloatType const &sin_angle_is_zero_threshold=1.e-10) |
| Returns rotation matrix mapping given_unit_vector onto target_unit_vector. | |
| template<typename FloatType> | |
| mat3< FloatType > | vector_to_001 (vec3< FloatType > const &given_unit_vector, FloatType const &sin_angle_is_zero_threshold=1.e-10) |
| Returns rotation matrix mapping given_unit_vector onto (0,0,1). | |
| template<typename FloatType> | |
| mat3< FloatType > | vector_to_010 (vec3< FloatType > const &given_unit_vector, FloatType const &sin_angle_is_zero_threshold=1.e-10) |
| Returns rotation matrix mapping given_unit_vector onto (0,1,0). | |
| template<typename FloatType> | |
| mat3< FloatType > | vector_to_100 (vec3< FloatType > const &given_unit_vector, FloatType const &sin_angle_is_zero_threshold=1.e-10) |
| Returns rotation matrix mapping given_unit_vector onto (1,0,0). | |
| template<typename FloatType> | |
| mat3< FloatType > | unit_quaternion_as_matrix (FloatType const &q0, FloatType const &q1, FloatType const &q2, FloatType const &q3) |
| Unit quaternion (a.k.a. Euler parameters) as matrix. | |
| template<typename FloatType> | |
| mat3< FloatType > | unit_quaternion_as_matrix (af::tiny< FloatType, 4 > const &q) |
| template<typename FloatType> | |
| af::tiny< FloatType, 4 > | matrix_as_unit_quaternion (mat3< FloatType > const &r) |
| Matrix as unit quaternion (a.k.a. Euler parameters). | |
| mat3<FloatType> scitbx::math::r3_rotation::axis_and_angle_as_matrix | ( | vec3< FloatType > const & | axis, | |
| FloatType | angle, | |||
| bool | deg = false, |
|||
| FloatType const & | min_axis_length = 1.e-15 | |||
| ) | [inline] |
Conversion of axis and angle to a rotation matrix.
http://skal.planet-d.net/demo/matrixfaq.htm
References SCITBX_ASSERT.
Referenced by axis_and_angle_from_matrix::as_matrix().
| af::tiny<FloatType, 4> scitbx::math::r3_rotation::matrix_as_unit_quaternion | ( | mat3< FloatType > const & | r | ) | [inline] |
Matrix as unit quaternion (a.k.a. Euler parameters).
The matrix elements must satisfy the orthogonality condition r.transpose()*r = identity but this is not thoroughly checked.
Based on work by: Shepperd (1978), J. Guidance and Control, 1, 223-224. Sam Buss, http://math.ucsd.edu/~sbuss/MathCG Robert Hanson, jmol/Jmol/src/org/jmol/util/Quaternion.java
Also implemented in Python: scitbx/matrix.py
| mat3<FloatType> scitbx::math::r3_rotation::unit_quaternion_as_matrix | ( | FloatType const & | q0, | |
| FloatType const & | q1, | |||
| FloatType const & | q2, | |||
| FloatType const & | q3 | |||
| ) | [inline] |
Unit quaternion (a.k.a. Euler parameters) as matrix.
The unit quaternion elements must satisfy the normalization condition q0**2+q1**2+q2**2+q3**3 = 1 but this is not checked.
Also implemented in Python: scitbx/matrix.py
| mat3<FloatType> scitbx::math::r3_rotation::vector_to_001 | ( | vec3< FloatType > const & | given_unit_vector, | |
| FloatType const & | sin_angle_is_zero_threshold = 1.e-10 | |||
| ) | [inline] |
Returns rotation matrix mapping given_unit_vector onto (0,0,1).
It is not checked if the input vector is a unit vector. The result is meaningless if this is not true.
The implementation is a simplification of vector_to_vector().
| mat3<FloatType> scitbx::math::r3_rotation::vector_to_010 | ( | vec3< FloatType > const & | given_unit_vector, | |
| FloatType const & | sin_angle_is_zero_threshold = 1.e-10 | |||
| ) | [inline] |
Returns rotation matrix mapping given_unit_vector onto (0,1,0).
It is not checked if the input vector is a unit vector. The result is meaningless if this is not true.
The implementation is a simplification of vector_to_vector().
| mat3<FloatType> scitbx::math::r3_rotation::vector_to_100 | ( | vec3< FloatType > const & | given_unit_vector, | |
| FloatType const & | sin_angle_is_zero_threshold = 1.e-10 | |||
| ) | [inline] |
Returns rotation matrix mapping given_unit_vector onto (1,0,0).
It is not checked if the input vector is a unit vector. The result is meaningless if this is not true.
The implementation is a simplification of vector_to_vector().
| mat3<FloatType> scitbx::math::r3_rotation::vector_to_vector | ( | vec3< FloatType > const & | given_unit_vector, | |
| vec3< FloatType > const & | target_unit_vector, | |||
| FloatType const & | sin_angle_is_zero_threshold = 1.e-10 | |||
| ) | [inline] |
Returns rotation matrix mapping given_unit_vector onto target_unit_vector.
It is not checked if the input vectors are unit vectors. The result is meaningless if this is not true.
See also: axis_and_angle_as_matrix()
References vec3::cross(), vec3::length(), and vec3::ortho().
1.5.6