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... | |
A 3x3 matrix class.
|
inline |
Constructor.
|
inline |
Copy constructor.
_m | Matrix to copy |
|
inline |
Constructor.
[in] | _v00 | Row 0, Col 0 value |
[in] | _v01 | Row 0, Col 1 value |
[in] | _v02 | Row 0, Col 2 value |
[in] | _v10 | Row 1, Col 0 value |
[in] | _v11 | Row 1, Col 1 value |
[in] | _v12 | Row 1, Col 2 value |
[in] | _v20 | Row 2, Col 0 value |
[in] | _v21 | Row 2, Col 1 value |
[in] | _v22 | Row 2, Col 2 value |
|
inline |
Construct Matrix3 from a quaternion.
[in] | _q | Quaternion. |
References ignition::math::Quaternion< T >::Normalize(), ignition::math::Matrix3< T >::Set(), ignition::math::Quaternion< T >::W(), ignition::math::Quaternion< T >::X(), ignition::math::Quaternion< T >::Y(), and ignition::math::Quaternion< T >::Z().
|
inlinevirtual |
Desctructor.
|
inline |
Set the matrix from three axis (1 per column)
[in] | _xAxis | The x axis |
[in] | _yAxis | The y axis |
[in] | _zAxis | The z axis |
References ignition::math::Matrix3< T >::Col().
|
inline |
Set the matrix from an axis and angle.
[in] | _axis | the axis |
[in] | _angle | ccw rotation around the axis in radians |
References ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().
|
inline |
Set a column.
[in] | _c | The colum index (0, 1, 2) |
[in] | _v | The 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().
|
inline |
Return the inverse matrix.
|
inline |
Inequality test operator.
[in] | _m | Matrix3<T> to test |
|
inline |
Array subscript operator.
[in] | _row | row index |
|
inline |
Array subscript operator.
[in] | _row | row index |
|
inline |
returns the element wise scalar multiplication
|
inline |
Matrix multiplication operator.
[in] | _m | Matrix3<T> to multiply |
|
inline |
Multiplication operator.
_vec | Vector3 |
References ignition::math::Vector3< T >::X(), ignition::math::Vector3< T >::Y(), and ignition::math::Vector3< T >::Z().
|
inline |
returns the element wise sum of two matrices
|
inline |
returns the element wise difference of two matrices
|
inline |
Equality test operator.
[in] | _m | Matrix3<T> to test |
References ignition::math::equal().
|
inline |
Set values.
[in] | _v00 | Row 0, Col 0 value |
[in] | _v01 | Row 0, Col 1 value |
[in] | _v02 | Row 0, Col 2 value |
[in] | _v10 | Row 1, Col 0 value |
[in] | _v11 | Row 1, Col 1 value |
[in] | _v12 | Row 1, Col 2 value |
[in] | _v20 | Row 2, Col 0 value |
[in] | _v21 | Row 2, Col 1 value |
[in] | _v22 | Row 2, Col 2 value |
Referenced by ignition::math::Matrix3< T >::Matrix3().
Matrix multiplication operator for scaling.
[in] | _s | Scaling factor. |
[in] | _m | Input matrix. |
|
friend |
Stream insertion operator.
[in] | _out | Output stream |
[in] | _m | Matrix to output |
|
friend |
Stream extraction operator.
_in | input stream |
_pt | Matrix3 to read values into |
|
static |
Identity matrix.
|
static |
Zero matrix.