Class of quaternion. More...


Public Member Functions | |
| MC_quaternion () | |
| zero contructor (set unitary axis (0,0,1) and zero angle ) | |
| MC_quaternion (const MC_v3d &axis, const double &angle) | |
| constructor from axis and angle | |
| MC_quaternion (const MC_v4d &v) | |
| constructor from base class: v4d | |
| MC_quaternion (const MC_quaternion &q) | |
| copy constructor | |
| MC_quaternion (const double &x, const double &y, const double &z, const double &w) | |
| direct constructor from coefficients | |
| MC_quaternion (const MC_matrix &v) | |
| build a quaternion from a rotation matrix | |
| MC_matrix | matrix () const |
| compute the rotation matrix associated to the current quaternion | |
| MC_quaternion | conjugated () const |
| get the conjugate of the current quaterion | |
| MC_quaternion & | operator*= (const MC_quaternion &q1) |
| internal multiplication between quaternion | |
| MC_quaternion | pow (const double &t) const |
| power of a quaternion with a double | |
| MC_quaternion | inverted () const |
| invert the quaternion | |
| MC_v3d | log () const |
| log map | |
| MC_v3d | axis () const |
| get the unit axis corresponding to the quaternion | |
| double | angle () const |
| get the angle corresponding to the quaternion | |
Static Public Member Functions | |
| static MC_quaternion | exp (const MC_v3d &v) |
| exp map | |
| static MC_quaternion | slerp (const MC_quaternion &q0, const MC_quaternion &q1, const double &t) |
| Spherical Linear Interpolation SLERP. | |
| static MC_quaternion | quat_interp (const std::vector< MC_quaternion > &quaternion_vec, const MC_double_vector &weights) |
| static MC_matrix | quat_interp (const std::vector< MC_matrix > &matrix_vec, const MC_double_vector &weights) |
| Generalized approximate spherical interpolation for rotation and linear one for translation. | |
| static MC_matrix | quat_interp (const std::vector< MC_quaternion > &quaternion_vec, const MC_double_vector &weights, const MC_v3d_vector &translation_vec) |
| Generalized approximate spherical interpolation for rotation and linear one for translation. | |
Friends | |
| MC_quaternion | operator* (const MC_quaternion &q0, const MC_quaternion &q1) |
| multiplication between quaternion | |
Class of quaternion.
internally based on v4d (axis_x,axis_y,axis_z,angle)
| mesh_conv::MC_quaternion::MC_quaternion | ( | ) |
zero contructor (set unitary axis (0,0,1) and zero angle )
Referenced by exp(), MC_quaternion(), and quat_interp().
| mesh_conv::MC_quaternion::MC_quaternion | ( | const MC_v3d & | axis, | |
| const double & | angle | |||
| ) |
constructor from axis and angle
References mesh_conv::MC_v4d::MC_v4d(), and mesh_conv::MC_v3d::normalized().

| mesh_conv::MC_quaternion::MC_quaternion | ( | const MC_v4d & | v | ) |
constructor from base class: v4d
| mesh_conv::MC_quaternion::MC_quaternion | ( | const MC_quaternion & | q | ) |
copy constructor
| mesh_conv::MC_quaternion::MC_quaternion | ( | const double & | x, | |
| const double & | y, | |||
| const double & | z, | |||
| const double & | w | |||
| ) |
direct constructor from coefficients
| mesh_conv::MC_quaternion::MC_quaternion | ( | const MC_matrix & | v | ) |
build a quaternion from a rotation matrix
References angle(), axis(), MC_quaternion(), and mesh_conv::MC_matrix::rotation_parameter().

| double mesh_conv::MC_quaternion::angle | ( | ) | const |
get the angle corresponding to the quaternion
Referenced by MC_quaternion().
| MC_v3d mesh_conv::MC_quaternion::axis | ( | ) | const |
get the unit axis corresponding to the quaternion
References mesh_conv::MC_v3d::normalized().
Referenced by MC_quaternion().

| MC_quaternion mesh_conv::MC_quaternion::conjugated | ( | ) | const |
get the conjugate of the current quaterion
Referenced by mesh_conv::MC_trackball::apply_rotation(), mesh_conv::MC_navigator_tool::current_cam1(), mesh_conv::MC_navigator_tool::current_light1(), mesh_conv::MC_navigator_tool::go_forward_trackball_cam1(), mesh_conv::MC_navigator_tool::go_right_trackball_cam1(), mesh_conv::MC_navigator_tool::go_up_trackball_cam1(), inverted(), mesh_conv::operator*(), and mesh_conv::MC_v3d::operator*=().
| MC_quaternion mesh_conv::MC_quaternion::exp | ( | const MC_v3d & | v | ) | [static] |
exp map
the exp is going from R3 -> S3
References MC_quaternion(), and mesh_conv::MC_v3d::norm().
Referenced by pow().

| MC_quaternion mesh_conv::MC_quaternion::inverted | ( | ) | const |
invert the quaternion
References conjugated(), and mesh_conv::MC_v4d::norm().

| MC_v3d mesh_conv::MC_quaternion::log | ( | ) | const |
| MC_matrix mesh_conv::MC_quaternion::matrix | ( | ) | const |
compute the rotation matrix associated to the current quaternion
Referenced by mesh_conv::MC_navigator_tool::current_cam1(), mesh_conv::MC_navigator_tool::current_light1(), and quat_interp().
| MC_quaternion & mesh_conv::MC_quaternion::operator*= | ( | const MC_quaternion & | q1 | ) |
internal multiplication between quaternion
References mesh_conv::MC_v3d::cross(), mesh_conv::MC_v3d::dot(), and mesh_conv::MC_v4d::set_v3d().

| MC_quaternion mesh_conv::MC_quaternion::pow | ( | const double & | t | ) | const |
| MC_matrix mesh_conv::MC_quaternion::quat_interp | ( | const std::vector< MC_quaternion > & | quaternion_vec, | |
| const MC_double_vector & | weights, | |||
| const MC_v3d_vector & | translation_vec | |||
| ) | [static] |
Generalized approximate spherical interpolation for rotation and linear one for translation.
References matrix(), quat_interp(), mesh_conv::MC_matrix::set_block(), mesh_conv::MC_v3d_vector::size(), mesh_conv::MC_double_vector::size(), and mesh_conv::MC_v3d_vector::sum().

| MC_matrix mesh_conv::MC_quaternion::quat_interp | ( | const std::vector< MC_matrix > & | matrix_vec, | |
| const MC_double_vector & | weights | |||
| ) | [static] |
Generalized approximate spherical interpolation for rotation and linear one for translation.
References matrix(), MC_quaternion(), quat_interp(), mesh_conv::MC_matrix::set_block(), and mesh_conv::MC_double_vector::size().

| MC_quaternion mesh_conv::MC_quaternion::quat_interp | ( | const std::vector< MC_quaternion > & | quaternion_vec, | |
| const MC_double_vector & | weights | |||
| ) | [static] |
Generalized approximate spherical interpolation for rotation
Compute sum(qi)/norm(sum(qi))
References mesh_conv::MC_v4d::norm(), and mesh_conv::MC_double_vector::size().
Referenced by quat_interp().

| MC_quaternion mesh_conv::MC_quaternion::slerp | ( | const MC_quaternion & | q0, | |
| const MC_quaternion & | q1, | |||
| const double & | t | |||
| ) | [static] |
Spherical Linear Interpolation SLERP.
Use (sin((1-t) theta )q0 +sin(t theta)q1)/sin(theta) But same results with (q1 q0^{-1})^{t} q0 (q1*q0.invert()).pow_q(t)*q0)
References mesh_conv::MC_v4d::dot().

| MC_quaternion operator* | ( | const MC_quaternion & | q0, | |
| const MC_quaternion & | q1 | |||
| ) | [friend] |
multiplication between quaternion
1.6.1