Public Types | Public Member Functions | Protected Attributes

mln::algebra::quat Class Reference

#include <quat.hh>

Inheritance diagram for mln::algebra::quat:
Inheritance graph

List of all members.

Public Types

typedef Value< void > category
typedef C enc
 Encoding associated type.
typedef V equiv
 Equivalent associated type.
typedef quat exact_t
typedef N interop
 Interoperation associated type.

Public Member Functions

quat conj () const
 Give the conjugate.
C & handle_ ()
quat inv () const
 Give the invert.
bool is_null () const
 Test if the quaternion is null.
bool is_pure () const
 Test if it is a pure quaternion.
bool is_unit () const
 Test if it is a unit quaternion.
 operator const algebra::vec< 4, float > & () const
 Implicit conversion to a 4D algebra::vec.
quatoperator= (const algebra::vec< 4, float > &v)
 Assignment from a 4D vector.
 quat ()
 Constructor without argument.
 quat (const algebra::vec< 4, float > &v)
 Constructor from a 4D vector.
 quat (float s, float x, float y, float z)
 Constructor with components.
 quat (unsigned one, float theta, const algebra::vec< 3, float > &uv)
 quat (float s, const algebra::vec< 3, float > &v)
 Constructor from a scalar and a 3D vector.
template<unsigned n, typename T >
algebra::vec< n, float > rotate (const algebra::vec< n, T > &v) const
 Rotate using quaternion definition of a rotation.
quat rotate (const quat &q) const
float s () const
 Give the scalar part.
float & s ()
 Access to the scalar part.
void set_theta (float theta)
quatset_unit ()
 Transform into unit quaternion.
template<typename T >
void set_unit (float theta, const algebra::vec< 3, T > &uv)
 Transform into unit quaternion.
void set_uv (const algebra::vec< 3, float > &uv)
void set_v (float x, float y, float z)
float sprod (const quat &rhs) const
 Scalar product.
float theta () const
const C & to_enc () const
 Explicit conversion towards encoding type.
to_equiv () const
 Explicit conversion towards equivalent type.
to_interop () const
 Explicit conversion towards interoperation type.
const algebra::vec< 4, float > & to_vec () const
 Explicit conversion to a 4D algebra::vec.
algebra::vec< 3, float > uv () const
algebra::vec< 3, float > & v ()
const algebra::vec< 3, float > & v () const

 quat (const literal::zero_t &)
 Constructors/assignments with literals zero and one.
quatoperator= (const literal::zero_t &)
 quat (const literal::one_t &)
quatoperator= (const literal::one_t &)

Protected Attributes

enc v_

Detailed Description

Definition at line 123 of file quat.hh.


Member Typedef Documentation

typedef Value<void> mln::Value< quat >::category [inherited]

Reimplemented from mln::Object< quat >.

Definition at line 59 of file core/concept/value.hh.

template<typename V, typename C, typename N, typename E>
typedef C mln::value::internal::value_like_< V, C, N, E >::enc [inherited]

Encoding associated type.

Reimplemented in mln::value::internal::gray_< n >, and mln::value::label< n >.

Definition at line 60 of file value_like.hh.

template<typename V, typename C, typename N, typename E>
typedef V mln::value::internal::value_like_< V, C, N, E >::equiv [inherited]

Equivalent associated type.

Reimplemented in mln::value::internal::gray_< n >.

Definition at line 57 of file value_like.hh.

typedef quat mln::Object< quat >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename V, typename C, typename N, typename E>
typedef N mln::value::internal::value_like_< V, C, N, E >::interop [inherited]

Interoperation associated type.

Definition at line 63 of file value_like.hh.


Constructor & Destructor Documentation

mln::algebra::quat::quat (  )  [inline]

Constructor without argument.

Definition at line 268 of file quat.hh.

Referenced by conj(), and rotate().

mln::algebra::quat::quat ( float  s,
float  x,
float  y,
float  z 
) [inline]

Constructor with components.

Definition at line 273 of file quat.hh.

References set_v(), and mln::value::internal::value_like_< V, C, N, E >::v_.

mln::algebra::quat::quat ( float  s,
const algebra::vec< 3, float > &  v 
) [inline]

Constructor from a scalar and a 3D vector.

Definition at line 280 of file quat.hh.

References v(), and mln::value::internal::value_like_< V, C, N, E >::v_.

mln::algebra::quat::quat ( const algebra::vec< 4, float > &  v  )  [inline]

Constructor from a 4D vector.

Definition at line 287 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

mln::algebra::quat::quat ( const literal::zero_t  )  [inline]

Constructors/assignments with literals zero and one.

Definition at line 304 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

mln::algebra::quat::quat ( const literal::one_t  )  [inline]

Definition at line 318 of file quat.hh.

References s(), and v().

mln::algebra::quat::quat ( unsigned  one,
float  theta,
const algebra::vec< 3, float > &  uv 
) [inline]

Definition at line 457 of file quat.hh.

References set_unit().


Member Function Documentation

quat mln::algebra::quat::conj (  )  const [inline]

Give the conjugate.

Definition at line 410 of file quat.hh.

References quat(), s(), and v().

Referenced by inv(), mln::algebra::slerp_2(), mln::algebra::slerp_3(), mln::algebra::slerp_4(), and mln::algebra::slerp_5().

template<typename V, typename C, typename N, typename E>
C& mln::value::internal::value_like_< V, C, N, E >::handle_ (  )  [inline, inherited]

Definition at line 76 of file value_like.hh.

Referenced by mln::value::operator>>().

quat mln::algebra::quat::inv (  )  const [inline]

Give the invert.

Definition at line 416 of file quat.hh.

References conj(), is_null(), mln::norm::l2(), to_vec(), and mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by rotate().

bool mln::algebra::quat::is_null (  )  const [inline]

Test if the quaternion is null.

Definition at line 398 of file quat.hh.

References mln::algebra::about_equal(), mln::norm::l2(), and mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by mln::registration::icp(), and inv().

bool mln::algebra::quat::is_pure (  )  const [inline]

Test if it is a pure quaternion.

Definition at line 404 of file quat.hh.

References mln::algebra::about_equal(), and mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by rotate().

bool mln::algebra::quat::is_unit (  )  const [inline]
mln::algebra::quat::operator const algebra::vec< 4, float > & (  )  const [inline]

Implicit conversion to a 4D algebra::vec.

Definition at line 342 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

quat & mln::algebra::quat::operator= ( const algebra::vec< 4, float > &  v  )  [inline]

Assignment from a 4D vector.

Definition at line 294 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

quat & mln::algebra::quat::operator= ( const literal::zero_t  )  [inline]

Definition at line 311 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

quat & mln::algebra::quat::operator= ( const literal::one_t  )  [inline]

Definition at line 326 of file quat.hh.

References s(), and v().

template<unsigned n, typename T >
algebra::vec< n, float > mln::algebra::quat::rotate ( const algebra::vec< n, T > &  v  )  const [inline]
quat mln::algebra::quat::rotate ( const quat q  )  const [inline]

Definition at line 503 of file quat.hh.

References inv(), is_pure(), and is_unit().

float mln::algebra::quat::s (  )  const [inline]

Give the scalar part.

Definition at line 349 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by conj(), mln::algebra::exp(), mln::algebra::operator*(), operator=(), quat(), and theta().

float & mln::algebra::quat::s (  )  [inline]

Access to the scalar part.

Definition at line 356 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

void mln::algebra::quat::set_theta ( float  theta  )  [inline]

Definition at line 472 of file quat.hh.

References is_unit(), set_unit(), and uv().

quat & mln::algebra::quat::set_unit (  )  [inline]

Transform into unit quaternion.

Definition at line 424 of file quat.hh.

References mln::algebra::about_equal(), is_unit(), mln::norm::l2(), to_vec(), and mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by mln::math::jacobi(), quat(), set_theta(), and set_uv().

template<typename T >
void mln::algebra::quat::set_unit ( float  theta,
const algebra::vec< 3, T > &  uv 
) [inline]

Transform into unit quaternion.

Definition at line 437 of file quat.hh.

References mln::algebra::about_equal(), mln::norm::l2(), and mln::value::internal::value_like_< V, C, N, E >::v_.

void mln::algebra::quat::set_uv ( const algebra::vec< 3, float > &  uv  )  [inline]

Definition at line 487 of file quat.hh.

References is_unit(), set_unit(), and theta().

void mln::algebra::quat::set_v ( float  x,
float  y,
float  z 
) [inline]

Definition at line 377 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by quat().

float mln::algebra::quat::sprod ( const quat rhs  )  const [inline]

Scalar product.

Definition at line 386 of file quat.hh.

References to_vec(), and mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by mln::algebra::slerp().

float mln::algebra::quat::theta (  )  const [inline]

Definition at line 465 of file quat.hh.

References is_unit(), and s().

Referenced by mln::algebra::log(), and set_uv().

template<typename V , typename C , typename N , typename E >
const C & mln::value::internal::value_like_< V, C, N, E >::to_enc (  )  const [inline, inherited]
template<typename V , typename C , typename N , typename E >
V mln::value::internal::value_like_< V, C, N, E >::to_equiv (  )  const [inline, inherited]

Explicit conversion towards equivalent type.

Definition at line 102 of file value_like.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.

Referenced by mln::convert::over_load::from_to_().

template<typename V , typename C , typename N , typename E >
N mln::value::internal::value_like_< V, C, N, E >::to_interop (  )  const [inline, inherited]
const algebra::vec< 4, float > & mln::algebra::quat::to_vec (  )  const [inline]
algebra::vec< 3, float > mln::algebra::quat::uv (  )  const [inline]

Definition at line 479 of file quat.hh.

References is_unit(), mln::algebra::vec< n, T >::normalize(), and v().

Referenced by mln::algebra::log(), and set_theta().

const algebra::vec< 3, float > & mln::algebra::quat::v (  )  const [inline]
algebra::vec< 3, float > & mln::algebra::quat::v (  )  [inline]

Definition at line 371 of file quat.hh.

References mln::value::internal::value_like_< V, C, N, E >::v_.


Member Data Documentation

template<typename V, typename C, typename N, typename E>
enc mln::value::internal::value_like_< V, C, N, E >::v_ [protected, inherited]

Definition at line 79 of file value_like.hh.

Referenced by mln::value::qt::rgb32::blue(), mln::value::rgb< n >::blue(), mln::value::qt::rgb32::comp(), mln::value::rgb< n >::comp(), mln::value::float01_< n >::float01_(), mln::value::float01_f::float01_f(), mln::value::internal::gray_< n >::gray_(), mln::value::internal::gray_f::gray_f(), mln::value::graylevel< n >::graylevel(), mln::value::graylevel_f::graylevel_f(), mln::value::qt::rgb32::green(), mln::value::rgb< n >::green(), mln::value::internal::value_like_< int, int, gray_< n >, gray_< n > >::handle_(), mln::value::int_s< n >::int_s(), mln::value::int_u< n >::int_u(), mln::value::int_u_sat< n >::int_u_sat(), inv(), is_null(), is_pure(), is_unit(), mln::value::label< n >::label(), mln::value::label< n >::next(), mln::value::int_u< n >::next(), mln::value::qt::rgb32::operator algebra::vec< 3, float >(), mln::value::rgb< n >::operator algebra::vec< 3, float >(), mln::value::qt::rgb32::operator algebra::vec< 3, int >(), mln::value::rgb< n >::operator algebra::vec< 3, int >(), operator const algebra::vec< 4, float > &(), mln::value::float01_f::operator float(), mln::value::float01_< n >::operator float(), mln::value::internal::gray_f::operator gray_< m >(), mln::value::internal::gray_< n >::operator gray_< m >(), mln::value::internal::gray_f::operator graylevel< m >(), mln::value::internal::gray_< n >::operator graylevel< m >(), mln::value::internal::gray_f::operator graylevel_f(), mln::value::internal::gray_< n >::operator graylevel_f(), mln::value::int_u_sat< n >::operator int(), mln::value::int_u< n >::operator unsigned(), mln::value::label< n >::operator++(), mln::value::int_u_sat< n >::operator+=(), mln::value::int_u< n >::operator-(), mln::value::label< n >::operator--(), mln::value::int_u_sat< n >::operator-=(), mln::value::qt::rgb32::operator=(), mln::value::rgb< n >::operator=(), operator=(), mln::value::label< n >::operator=(), mln::value::int_u_sat< n >::operator=(), mln::value::int_u< n >::operator=(), mln::value::int_s< n >::operator=(), mln::value::graylevel_f::operator=(), mln::value::graylevel< n >::operator=(), mln::value::internal::gray_f::operator=(), mln::value::internal::gray_< n >::operator=(), mln::value::float01_f::operator=(), mln::value::float01_< n >::operator=(), mln::value::label< n >::prev(), quat(), mln::value::qt::rgb32::red(), mln::value::rgb< n >::red(), mln::value::rgb< n >::rgb(), mln::value::qt::rgb32::rgb32(), s(), mln::value::float01_< n >::set_ind(), set_unit(), set_v(), sprod(), mln::value::internal::value_like_< V, C, N, E >::to_enc(), mln::value::internal::value_like_< V, C, N, E >::to_equiv(), mln::value::graylevel< n >::to_float(), to_vec(), v(), mln::value::graylevel_f::value(), mln::value::graylevel< n >::value(), mln::value::internal::gray_f::value(), mln::value::internal::gray_< n >::value(), mln::value::float01_f::value(), and mln::value::float01_< n >::value().