#include <Matrix2x2.h>
Public Member Functions | |
| Matrix2x2 (void) | |
| Matrix2x2 (const Matrix2x2 &m) | |
| Matrix2x2 & | operator= (const Matrix2x2 &m) |
| void | swap (Matrix2x2 &m) |
| ~Matrix2x2 (void) | |
| Matrix2x2 (const float _11, const float _12, const float _21, const float _22) | |
| Matrix2x2 (const float phi) | |
| const float | det () const |
| const Matrix2x2 | transposed () const |
| const Matrix2x2 | inverted () const |
| const float | operator[] (unsigned index) const |
| float & | operator[] (unsigned index) |
| const Vector2 | get (unsigned i) const |
| const Matrix2x2 & | set (unsigned i, const Vector2 &v) |
| const Matrix2x2 & | set (const ml7::Vector2 &x, const ml7::Vector2 &y) |
| const float | angle () const |
| const Matrix2x2 | operator- () const |
| const Matrix2x2 | operator+ (const Matrix2x2 &m) const |
| const Matrix2x2 | operator- (const Matrix2x2 &m) const |
| const Matrix2x2 | operator* (const float s) const |
| const Vector2 | operator* (const Vector2 &v) const |
| const Matrix2x2 | operator* (const Matrix2x2 &m) const |
| const Vector2 | trans (const Vector2 &v) const |
| const Vector2 | transinv (const Vector2 &v) const |
| Matrix2x2 & | operator+= (const Matrix2x2 &m) |
| Matrix2x2 & | operator-= (const Matrix2x2 &m) |
| Matrix2x2 & | operator*= (const float s) |
| Matrix2x2 & | operator*= (const Matrix2x2 &m) |
| Matrix2x2 & | clear () |
| Matrix2x2 & | identity () |
| Matrix2x2 & | transpose () |
| Matrix2x2 & | transpose (const Matrix2x2 &m) |
| Matrix2x2 & | invert () |
| Matrix2x2 & | invert (const Matrix2x2 &m) |
| Matrix2x2 & | rotation (const float phi) |
| const bool | operator== (const Matrix2x2 &m) const |
| const bool | operator!= (const Matrix2x2 &m) const |
| const bool | operator< (const Matrix2x2 &m) const |
| const bool | operator> (const Matrix2x2 &m) const |
| const bool | operator<= (const Matrix2x2 &m) const |
| const bool | operator>= (const Matrix2x2 &m) const |
| operator const float *const () const | |
| operator float *const () | |
Public Attributes | |
| union { | |
| struct { | |
| float a | |
| float b | |
| float c | |
| float d | |
| } | |
| struct { | |
| float _11 | |
| float _12 | |
| float _21 | |
| float _22 | |
| } | |
| float data [4] | |
| float m [2][2] | |
| }; | |
Represents a 2x2-matrix for rotating 2d-vectors. Used for 2d-physics and -graphics.
| ml7::Matrix2x2::Matrix2x2 | ( | void | ) | [inline] |
Default constructor. Creates a new identity matrix representing a zero rotation.
| ml7::Matrix2x2::Matrix2x2 | ( | const Matrix2x2 & | m | ) | [inline] |
Copy constructor. Copies a given matrix m.
| ml7::Matrix2x2::~Matrix2x2 | ( | void | ) | [inline] |
Destructor.
| ml7::Matrix2x2::Matrix2x2 | ( | const float | _11, | |
| const float | _12, | |||
| const float | _21, | |||
| const float | _22 | |||
| ) | [inline] |
Explicit constructor with parameters for each element.
| ml7::Matrix2x2::Matrix2x2 | ( | const float | phi | ) | [inline, explicit] |
Explicit constructor. Creates a rotation matrix by a ccw-angle phi in radians.
| const float ml7::Matrix2x2::angle | ( | ) | const [inline] |
Returns the angle of the counter-clockwise rotation represented by this matrix.
| Matrix2x2& ml7::Matrix2x2::clear | ( | ) | [inline] |
Forces this matrix to be an empty matrix representing no legal rotation.
| const float ml7::Matrix2x2::det | ( | ) | const [inline] |
Returns the determinant of this matrix.
| const Vector2 ml7::Matrix2x2::get | ( | unsigned | i | ) | const [inline] |
Returns the i-th (0-indexed) column vector of this matrix.
| Matrix2x2& ml7::Matrix2x2::identity | ( | ) | [inline] |
Forces this matrix to be an identity matrix representing a zero rotation.
| Matrix2x2& ml7::Matrix2x2::invert | ( | ) | [inline] |
Inverts this matrix. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.
Replaces this matrix by a given matrix m inverted. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.
| const Matrix2x2 ml7::Matrix2x2::inverted | ( | ) | const [inline] |
Copies this matrix and inverts it. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.
| ml7::Matrix2x2::operator const float *const | ( | ) | const [inline] |
| ml7::Matrix2x2::operator float *const | ( | ) | [inline] |
| const bool ml7::Matrix2x2::operator!= | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if a given matrix m and this have non-identical elements.
Returns a copy of a given vector v tranformed by this matrix.
Returns a copy of a given matrix m transformed by this.
| const Matrix2x2 ml7::Matrix2x2::operator* | ( | const float | s | ) | const [inline] |
Returns a copy of this matrix scaled by a given scalar s.
| Matrix2x2& ml7::Matrix2x2::operator*= | ( | const float | s | ) | [inline] |
Scales this matrix by a given scalar s.
Transforms this matrix by a given matrix m. It results in an operation identical to m * this.
Returns a given matrix m added to this.
Adds a given matrix m to this.
| const Matrix2x2 ml7::Matrix2x2::operator- | ( | ) | const [inline] |
Returns a copy of this matrix with the elements having signs flipped.
Returns a given matrix m subtracted from this.
Subtracts a given matrix m from this.
| const bool ml7::Matrix2x2::operator< | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if the angle of the rotation represented by this matrix is less than that of a given matrix m.
| const bool ml7::Matrix2x2::operator<= | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if the angle of the rotation represented by this matrix is less than or equal to that of a given matrix m.
Copy assignment operator. Copies the elements of a given matrix m.
| const bool ml7::Matrix2x2::operator== | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if a given matrix m and this have identical elements.
| const bool ml7::Matrix2x2::operator> | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if the angle of the rotation represented by this matrix is greater than that of a given matrix m.
| const bool ml7::Matrix2x2::operator>= | ( | const Matrix2x2 & | m | ) | const [inline] |
Checks if the angle of the rotation represented by this matrix is greater than or equal to that of a given matrix m.
| float& ml7::Matrix2x2::operator[] | ( | unsigned | index | ) | [inline] |
Indexed component access.
| const float ml7::Matrix2x2::operator[] | ( | unsigned | index | ) | const [inline] |
Indexed component access.
| Matrix2x2& ml7::Matrix2x2::rotation | ( | const float | phi | ) | [inline] |
Forces this matrix to be a rotation matrix with a ccw-angle phi.
| const Matrix2x2& ml7::Matrix2x2::set | ( | const ml7::Vector2 & | x, | |
| const ml7::Vector2 & | y | |||
| ) | [inline] |
Sets the column vectors of this matrix.
Sets the i-th (0-indexed) column vector of this matrix.
| void ml7::Matrix2x2::swap | ( | Matrix2x2 & | m | ) | [inline] |
Swap operation. Swaps the elements of a given matrix m with this.
Returns a copy of a given vector v transformed by this matrix.
Returns a copy of a given vector v transformed by this matrix inverted.
Replaces this matrix by a given matrix m transposed.
| Matrix2x2& ml7::Matrix2x2::transpose | ( | ) | [inline] |
Transposes this matrix.
| const Matrix2x2 ml7::Matrix2x2::transposed | ( | ) | const [inline] |
Copies this matrix and transposes it.
| union { ... } |
| float ml7::Matrix2x2::_11 |
Element in the 1st row and 1st column.
| float ml7::Matrix2x2::_12 |
Element in the 1st row and 2nd column.
| float ml7::Matrix2x2::_21 |
Element in the 2nd row and 1st column.
| float ml7::Matrix2x2::_22 |
Element in the 2nd row and 2nd column.
| float ml7::Matrix2x2::a |
Element in the 1st row and 1st column.
| float ml7::Matrix2x2::b |
Element in the 1st row and 2nd column.
| float ml7::Matrix2x2::c |
Element in the 2nd row and 1st column.
| float ml7::Matrix2x2::d |
Element in the 2nd row and 2nd column.
| float ml7::Matrix2x2::data[4] |
Array of the elements.
| float ml7::Matrix2x2::m[2][2] |
2d-array of the elements.
1.7.1