All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Public Member Functions | Static Public Attributes | Friends | List of all members
ignition::math::Matrix3< T > Class Template Reference

A 3x3 matrix class. More...

#include <ignition/math/Matrix3.hh>

Public Member Functions

 Matrix3 ()
 Constructor. More...
 
 Matrix3 (const Matrix3< T > &_m)
 Copy constructor. More...
 
 Matrix3 (T _v00, T _v01, T _v02, T _v10, T _v11, T _v12, T _v20, T _v21, T _v22)
 Constructor. More...
 
 Matrix3 (const Quaternion< T > &_q)
 Construct Matrix3 from a quaternion. More...
 
virtual ~Matrix3 ()
 Desctructor. More...
 
void Axes (const Vector3< T > &_xAxis, const Vector3< T > &_yAxis, const Vector3< T > &_zAxis)
 Set the matrix from three axis (1 per column) More...
 
void Axis (const Vector3< T > &_axis, T _angle)
 Set the matrix from an axis and angle. More...
 
void Col (unsigned int _c, const Vector3< T > &_v)
 Set a column. More...
 
Matrix3< T > Inverse () const
 Return the inverse matrix. More...
 
bool operator!= (const Matrix3< T > &_m) const
 Inequality test operator. More...
 
const T & operator() (size_t _row, size_t _col) const
 Array subscript operator. More...
 
T & operator() (size_t _row, size_t _col)
 Array subscript operator. More...
 
Matrix3< T > operator* (const T &_s) const
 returns the element wise scalar multiplication More...
 
Matrix3< T > operator* (const Matrix3< T > &_m) const
 Matrix multiplication operator. More...
 
Vector3< T > operator* (const Vector3< T > &_vec) const
 Multiplication operator. More...
 
Matrix3< T > operator+ (const Matrix3< T > &_m) const
 returns the element wise sum of two matrices More...
 
Matrix3< T > operator- (const Matrix3< T > &_m) const
 returns the element wise difference of two matrices More...
 
bool operator== (const Matrix3< T > &_m) const
 Equality test operator. More...
 
void Set (T _v00, T _v01, T _v02, T _v10, T _v11, T _v12, T _v20, T _v21, T _v22)
 Set values. More...
 

Static Public Attributes

static const Matrix3< T > Identity
 Identity matrix. More...
 
static const Matrix3< T > Zero
 Zero matrix. More...
 

Friends

Matrix3< T > operator* (T _s, const Matrix3< T > &_m)
 Matrix multiplication operator for scaling. More...
 
std::ostream & operator<< (std::ostream &_out, const ignition::math::Matrix3< T > &_m)
 Stream insertion operator. More...
 
std::istream & operator>> (std::istream &_in, ignition::math::Matrix3< T > &_m)
 Stream extraction operator. More...
 

Detailed Description

template<typename T>
class ignition::math::Matrix3< T >

A 3x3 matrix class.

Constructor & Destructor Documentation

template<typename T>
ignition::math::Matrix3< T >::Matrix3 ( )
inline

Constructor.

template<typename T>
ignition::math::Matrix3< T >::Matrix3 ( const Matrix3< T > &  _m)
inline

Copy constructor.

Parameters
_mMatrix to copy
template<typename T>
ignition::math::Matrix3< T >::Matrix3 ( _v00,
_v01,
_v02,
_v10,
_v11,
_v12,
_v20,
_v21,
_v22 
)
inline

Constructor.

Parameters
[in]_v00Row 0, Col 0 value
[in]_v01Row 0, Col 1 value
[in]_v02Row 0, Col 2 value
[in]_v10Row 1, Col 0 value
[in]_v11Row 1, Col 1 value
[in]_v12Row 1, Col 2 value
[in]_v20Row 2, Col 0 value
[in]_v21Row 2, Col 1 value
[in]_v22Row 2, Col 2 value
template<typename T>
ignition::math::Matrix3< T >::Matrix3 ( const Quaternion< T > &  _q)
inline
template<typename T>
virtual ignition::math::Matrix3< T >::~Matrix3 ( )
inlinevirtual

Desctructor.

Member Function Documentation

template<typename T>
void ignition::math::Matrix3< T >::Axes ( const Vector3< T > &  _xAxis,
const Vector3< T > &  _yAxis,
const Vector3< T > &  _zAxis 
)
inline

Set the matrix from three axis (1 per column)

Parameters
[in]_xAxisThe x axis
[in]_yAxisThe y axis
[in]_zAxisThe z axis

References ignition::math::Matrix3< T >::Col().

template<typename T>
void ignition::math::Matrix3< T >::Axis ( const Vector3< T > &  _axis,
_angle 
)
inline

Set the matrix from an axis and angle.

Parameters
[in]_axisthe axis
[in]_angleccw rotation around the axis in radians

References ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().

template<typename T>
void ignition::math::Matrix3< T >::Col ( unsigned int  _c,
const Vector3< T > &  _v 
)
inline

Set a column.

Parameters
[in]_cThe colum index (0, 1, 2)
[in]_vThe value to set in each row of the column

References ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().

Referenced by ignition::math::Matrix3< T >::Axes().

template<typename T>
Matrix3<T> ignition::math::Matrix3< T >::Inverse ( ) const
inline

Return the inverse matrix.

Returns
Inverse of this matrix.
template<typename T>
bool ignition::math::Matrix3< T >::operator!= ( const Matrix3< T > &  _m) const
inline

Inequality test operator.

Parameters
[in]_mMatrix3<T> to test
Returns
True if not equal (using the default tolerance of 1e-6)
template<typename T>
const T& ignition::math::Matrix3< T >::operator() ( size_t  _row,
size_t  _col 
) const
inline

Array subscript operator.

Parameters
[in]_rowrow index
Returns
a pointer to the row
template<typename T>
T& ignition::math::Matrix3< T >::operator() ( size_t  _row,
size_t  _col 
)
inline

Array subscript operator.

Parameters
[in]_rowrow index
Returns
a pointer to the row
template<typename T>
Matrix3<T> ignition::math::Matrix3< T >::operator* ( const T &  _s) const
inline

returns the element wise scalar multiplication

template<typename T>
Matrix3<T> ignition::math::Matrix3< T >::operator* ( const Matrix3< T > &  _m) const
inline

Matrix multiplication operator.

Parameters
[in]_mMatrix3<T> to multiply
Returns
product of this * _m
template<typename T>
Vector3<T> ignition::math::Matrix3< T >::operator* ( const Vector3< T > &  _vec) const
inline

Multiplication operator.

Parameters
_vecVector3
Returns
Resulting vector from multiplication

References ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().

template<typename T>
Matrix3<T> ignition::math::Matrix3< T >::operator+ ( const Matrix3< T > &  _m) const
inline

returns the element wise sum of two matrices

template<typename T>
Matrix3<T> ignition::math::Matrix3< T >::operator- ( const Matrix3< T > &  _m) const
inline

returns the element wise difference of two matrices

template<typename T>
bool ignition::math::Matrix3< T >::operator== ( const Matrix3< T > &  _m) const
inline

Equality test operator.

Parameters
[in]_mMatrix3<T> to test
Returns
True if equal (using the default tolerance of 1e-6)

References ignition::math::equal().

template<typename T>
void ignition::math::Matrix3< T >::Set ( _v00,
_v01,
_v02,
_v10,
_v11,
_v12,
_v20,
_v21,
_v22 
)
inline

Set values.

Parameters
[in]_v00Row 0, Col 0 value
[in]_v01Row 0, Col 1 value
[in]_v02Row 0, Col 2 value
[in]_v10Row 1, Col 0 value
[in]_v11Row 1, Col 1 value
[in]_v12Row 1, Col 2 value
[in]_v20Row 2, Col 0 value
[in]_v21Row 2, Col 1 value
[in]_v22Row 2, Col 2 value

Referenced by ignition::math::Matrix3< T >::Matrix3().

Friends And Related Function Documentation

template<typename T>
Matrix3<T> operator* ( _s,
const Matrix3< T > &  _m 
)
friend

Matrix multiplication operator for scaling.

Parameters
[in]_sScaling factor.
[in]_mInput matrix.
Returns
A scaled matrix.
template<typename T>
std::ostream& operator<< ( std::ostream &  _out,
const ignition::math::Matrix3< T > &  _m 
)
friend

Stream insertion operator.

Parameters
[in]_outOutput stream
[in]_mMatrix to output
Returns
the stream
template<typename T>
std::istream& operator>> ( std::istream &  _in,
ignition::math::Matrix3< T > &  _m 
)
friend

Stream extraction operator.

Parameters
_ininput stream
_ptMatrix3 to read values into
Returns
the stream

Member Data Documentation

template<typename T>
const Matrix3< T > ignition::math::Matrix3< T >::Identity
static

Identity matrix.

template<typename T>
const Matrix3< T > ignition::math::Matrix3< T >::Zero
static

Zero matrix.


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