Skip to content

Class ILLIXR::data_format::proper_quaternion

template <typename Scalar_, int Options_>

ClassList > ILLIXR > data_format > proper_quaternion

A more complete implementation of the Eigen::Quaternion. More...

  • #include <proper_quaternion.hpp>

Inherits the following classes: Eigen::Quaternion< Scalar_, Eigen::AutoAlign >

Public Types

Type Name
typedef Eigen::Quaternion< Scalar_ >::Base Base

Public Functions

Type Name
Eigen::Matrix< Scalar_, 4, 1 > asVector () const
Convert theis object into a 4-element vector, with the order x, y, z, w.
proper_quaternion< T > cast ()
Cast a ProperQuaternion from one type to another.
void normalize ()
Normalize the quaternion, but check w first, as it needs to be positive for our conventions.
proper_quaternion operator* (const int a) const
Integer multiplication, returning a new instance.
proper_quaternion operator* (const float a) const
Float multiplication, returning a new instance.
proper_quaternion operator* (const double a) const
Double multiplication, returning a new instance.
proper_quaternion< Scalar_ > operator* (const Eigen::Quaternion< Scalar_ > & other) const
Multiplication operator with and Eigen::Quaternion.
proper_quaternion & operator*= (const Scalar_ & a)
Scalar multiplication and assignment operator.
proper_quaternion< Scalar_ > operator+ (const proper_quaternion< Scalar_ > & other) const
Addition operator with another ProperQuaternion.
proper_quaternion< Scalar_ > & operator+= (const proper_quaternion< Scalar_ > & other)
In place addition operator with another ProperQuaternion.
proper_quaternion & operator= (const proper_quaternion & other)
Copy operator.
proper_quaternion () = default
proper_quaternion (const proper_quaternion & other) = default
proper_quaternion (const Eigen::Quaternion< Scalar_, Options_ > & other)
proper_quaternion (const Scalar_ & w, const Scalar_ & x, const Scalar_ & y, const Scalar_ & z)
proper_quaternion (const Scalar_ & w, const Eigen::MatrixBase< Derived > & vec)
proper_quaternion (const Scalar_ * data)
proper_quaternion (const Eigen::Matrix< Scalar_, 4, 1 > & vec)
proper_quaternion (const Eigen::QuaternionBase< Derived > & other)

Detailed Description

The base class, Eigen::Quaternion, is missing some arithmetic functionality, like scalar multiplication, this implementation adds this functionality.

Template parameters:

  • Scalar_ The type of data the Quaternion holds (typically double ot float)
  • Options_ Data alignment

Public Types Documentation

typedef Base

typedef Eigen::Quaternion<Scalar_>::Base ILLIXR::data_format::proper_quaternion< Scalar_, Options_ >::Base;

Public Functions Documentation

function asVector

Convert theis object into a 4-element vector, with the order x, y, z, w.

inline Eigen::Matrix< Scalar_, 4, 1 > ILLIXR::data_format::proper_quaternion::asVector () const

Returns:

The vector representing this instance.


function cast

Cast a ProperQuaternion from one type to another.

template<typename T>
inline proper_quaternion < T > ILLIXR::data_format::proper_quaternion::cast () 

Template parameters:

  • T

Returns:

The new ProperQuaternion instance of the correct type


function normalize

Normalize the quaternion, but check w first, as it needs to be positive for our conventions.

inline void ILLIXR::data_format::proper_quaternion::normalize () 


function operator*

Integer multiplication, returning a new instance.

inline proper_quaternion ILLIXR::data_format::proper_quaternion::operator* (
    const int a
) const

Parameters:

  • a Integer to multiply the quaternion by

Returns:

New instance containing the result


function operator*

Float multiplication, returning a new instance.

inline proper_quaternion ILLIXR::data_format::proper_quaternion::operator* (
    const float a
) const

Parameters:

  • a Float to multiply the quaternion by

Returns:

New instance containing the result


function operator*

Double multiplication, returning a new instance.

inline proper_quaternion ILLIXR::data_format::proper_quaternion::operator* (
    const double a
) const

Parameters:

  • a Double to multiply the quaternion by

Returns:

New instance containing the result


function operator*

Multiplication operator with and Eigen::Quaternion.

inline proper_quaternion < Scalar_ > ILLIXR::data_format::proper_quaternion::operator* (
    const Eigen::Quaternion< Scalar_ > & other
) const

Parameters:

  • other The Eigen::Quaternion to multiply by

Returns:

The resulting Quaternion


function operator*=

Scalar multiplication and assignment operator.

inline proper_quaternion & ILLIXR::data_format::proper_quaternion::operator*= (
    const Scalar_ & a
) 

Parameters:

  • a Scalar to multiply the Quaternion by

Returns:

Reference to the updated object


function operator+

Addition operator with another ProperQuaternion.

inline proper_quaternion < Scalar_ > ILLIXR::data_format::proper_quaternion::operator+ (
    const proper_quaternion < Scalar_ > & other
) const

Parameters:

  • other A ProperQuaternion to add to this one

Returns:

The resulting ProperQuaternion as a new instance


function operator+=

In place addition operator with another ProperQuaternion.

inline proper_quaternion < Scalar_ > & ILLIXR::data_format::proper_quaternion::operator+= (
    const proper_quaternion < Scalar_ > & other
) 

Parameters:

  • other A ProperQuaternion to add to this one

Returns:

Reference to the updated instance


function operator=

Copy operator.

inline proper_quaternion & ILLIXR::data_format::proper_quaternion::operator= (
    const proper_quaternion & other
) 

Parameters:

  • other A ProperQuaternion instance

Returns:

a copy


function proper_quaternion [1/8]

ILLIXR::data_format::proper_quaternion::proper_quaternion () = default

function proper_quaternion [2/8]

ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const proper_quaternion & other
) = default

function proper_quaternion [3/8]

inline explicit ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Eigen::Quaternion< Scalar_, Options_ > & other
) 

Copy constructor from the base class

Parameters:

  • other An Eigen::Quaternion instance

function proper_quaternion [4/8]

inline ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Scalar_ & w,
    const Scalar_ & x,
    const Scalar_ & y,
    const Scalar_ & z
) 

Constructor from individual components

Parameters:

  • w The w component
  • x The x component
  • y The y component
  • z The z component

function proper_quaternion [5/8]

template<typename Derived>
inline ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Scalar_ & w,
    const Eigen::MatrixBase< Derived > & vec
) 

Constructor from a scalar and vector

Template parameters:

  • Derived

Parameters:

  • w The w component
  • vec The x, y, and z components

function proper_quaternion [6/8]

inline explicit ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Scalar_ * data
) 

Constructor from a pointer array (assumes 4 elements)

Parameters:

  • data Pointer to the first element

function proper_quaternion [7/8]

inline explicit ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Eigen::Matrix< Scalar_, 4, 1 > & vec
) 

Constructor from a vector. Assumes the vector is x, y, z, w order.

Parameters:

  • vec The input vector

function proper_quaternion [8/8]

template<typename Derived>
inline explicit ILLIXR::data_format::proper_quaternion::proper_quaternion (
    const Eigen::QuaternionBase< Derived > & other
) 

Constructor which casts the data type

Template parameters:

  • Derived

Parameters:

  • other


The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/include/illixr/data_format/proper_quaternion.hpp