@ -162,7 +162,7 @@ template<class T> class Quaternion {
* Expects that the rotation axis is normalized . @ f [
* Expects that the rotation axis is normalized . @ f [
* q = [ \ boldsymbol a \ cdot sin \ frac \ theta 2 , cos \ frac \ theta 2 ]
* q = [ \ boldsymbol a \ cdot sin \ frac \ theta 2 , cos \ frac \ theta 2 ]
* @ f ]
* @ f ]
* @ see rot ationA ngle( ) , rot ationA xis( ) , DualQuaternion : : rotation ( ) ,
* @ see angle ( ) , axis ( ) , DualQuaternion : : rotation ( ) ,
* Matrix4 : : rotation ( ) , Complex : : rotation ( ) , Vector3 : : xAxis ( ) ,
* Matrix4 : : rotation ( ) , Complex : : rotation ( ) , Vector3 : : xAxis ( ) ,
* Vector3 : : yAxis ( ) , Vector3 : : zAxis ( ) , Vector : : isNormalized ( )
* Vector3 : : yAxis ( ) , Vector3 : : zAxis ( ) , Vector : : isNormalized ( )
*/
*/
@ -247,12 +247,11 @@ template<class T> class Quaternion {
* Expects that the quaternion is normalized . @ f [
* Expects that the quaternion is normalized . @ f [
* \ theta = 2 \ cdot acos q_S
* \ theta = 2 \ cdot acos q_S
* @ f ]
* @ f ]
* @ see isNormalized ( ) , rotationAxis ( ) , rotation ( ) ,
* @ see isNormalized ( ) , axis ( ) , rotation ( )
* DualQuaternion : : rotationAngle ( )
*/
*/
inline Rad < T > rot ationA ngle( ) const {
inline Rad < T > angle ( ) const {
CORRADE_ASSERT ( isNormalized ( ) ,
CORRADE_ASSERT ( isNormalized ( ) ,
" Math::Quaternion::rot ationA ngle(): quaternion must be normalized " ,
" Math::Quaternion::angle(): quaternion must be normalized " ,
Rad < T > ( std : : numeric_limits < T > : : quiet_NaN ( ) ) ) ;
Rad < T > ( std : : numeric_limits < T > : : quiet_NaN ( ) ) ) ;
return Rad < T > ( T ( 2 ) * std : : acos ( _scalar ) ) ;
return Rad < T > ( T ( 2 ) * std : : acos ( _scalar ) ) ;
}
}
@ -265,11 +264,11 @@ template<class T> class Quaternion {
* default - constructed quaternion . @ f [
* default - constructed quaternion . @ f [
* \ boldsymbol a = \ frac { \ boldsymbol q_V } { \ sqrt { 1 - q_S ^ 2 } }
* \ boldsymbol a = \ frac { \ boldsymbol q_V } { \ sqrt { 1 - q_S ^ 2 } }
* @ f ]
* @ f ]
* @ see isNormalized ( ) , rot ationA ngle( ) , rotation ( )
* @ see isNormalized ( ) , angle ( ) , rotation ( )
*/
*/
inline Vector3 < T > rot ationA xis( ) const {
inline Vector3 < T > axis ( ) const {
CORRADE_ASSERT ( isNormalized ( ) ,
CORRADE_ASSERT ( isNormalized ( ) ,
" Math::Quaternion::rot ationA xis(): quaternion must be normalized " ,
" Math::Quaternion::axis(): quaternion must be normalized " ,
{ } ) ;
{ } ) ;
return _vector / std : : sqrt ( 1 - pow2 ( _scalar ) ) ;
return _vector / std : : sqrt ( 1 - pow2 ( _scalar ) ) ;
}
}