mesh_conv::MC_quaternion Class Reference

Class of quaternion. More...

Inheritance diagram for mesh_conv::MC_quaternion:
Inheritance graph
[legend]
Collaboration diagram for mesh_conv::MC_quaternion:
Collaboration graph
[legend]

List of all members.

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_quaternionoperator*= (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

Detailed Description

Class of quaternion.

internally based on v4d (axis_x,axis_y,axis_z,angle)


Constructor & Destructor Documentation

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().

Here is the call graph for this function:

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

Warning:
the matrix must be 3x3 (or 4x4)

References angle(), axis(), MC_quaternion(), and mesh_conv::MC_matrix::rotation_parameter().

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

MC_quaternion mesh_conv::MC_quaternion::conjugated (  )  const
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().

Here is the call graph for this function:

MC_quaternion mesh_conv::MC_quaternion::inverted (  )  const

invert the quaternion

Returns:
Q^-1 = (Q*)/||Q||

References conjugated(), and mesh_conv::MC_v4d::norm().

Here is the call graph for this function:

MC_v3d mesh_conv::MC_quaternion::log (  )  const

log map

the log is going from S3 -> R3

Referenced by pow().

MC_matrix mesh_conv::MC_quaternion::matrix (  )  const

compute the rotation matrix associated to the current quaternion

Returns:
a 3x3 rotation matrix

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().

Here is the call graph for this function:

MC_quaternion mesh_conv::MC_quaternion::pow ( const double &  t  )  const

power of a quaternion with a double

Returns:
exp(t*log_q(q))

References exp(), and log().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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.

Returns:
a 4x4 matrix

References matrix(), MC_quaternion(), quat_interp(), mesh_conv::MC_matrix::set_block(), and mesh_conv::MC_double_vector::size().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Friends And Related Function Documentation

MC_quaternion operator* ( const MC_quaternion q0,
const MC_quaternion q1 
) [friend]

multiplication between quaternion


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

Generated on Wed Nov 11 17:13:53 2009 by  doxygen 1.6.1