|
API Links
Developer Links
|
class Matrix3D
Defined in: C4Matrix3D.h
The Matrix3D class encapsulates a 3 × 3 matrix.
Definition
class Matrix3D
Member Functions
Constructor
Matrix3D();
Matrix3D(const Vector3D& c1, const Vector3D& c2, const Vector3D& c3);
Matrix3D(float n00, float n01, float n02, float n10, float n11, float n12, float n20, float n21, float n22);
Parameters
c1 |
The values of the entries residing in first column.
|
c2 |
The values of the entries residing in second column.
|
c3 |
The values of the entries residing in third column.
|
nij |
The value of the entry residing in row i and column j.
|
Description
The Matrix3D class is used to store a 3 × 3 matrix. The entries of the matrix are accessed using the () operator with two indexes specifying the row and column of an entry.
The default constructor leaves the entries of the matrix undefined. If the nine entries are supplied, then the nij parameter specifies the entry in the i-th row and j-th column. If the matrix is constructed using the three vectors c1, c2, and c3, then these vectors initialize the three columns of the matrix.
Overloaded Operators
float& operator ()(long i, long j); |
Returns a reference to the entry in the i-th row and j-th column. Both i and j must be 0, 1, or 2.
|
const float& operator ()(long i, long j) const; |
Returns a constant reference to the entry in the i-th row and j-th column. Both i and j must be 0, 1, or 2.
|
Vector3D& operator [](long j); |
Returns a reference to the j-th column of a matrix. j must be 0, 1, or 2.
|
const Vector3D& operator [](long j) const; |
Returns a constant reference to the j-th column of a matrix. j must be 0, 1, or 2.
|
Matrix3D& operator *=(const Matrix3D& m); |
Multiplies by the matrix m.
|
Matrix3D& operator *=(float t); |
Multiplies by the scalar t.
|
Matrix3D& operator /=(float t); |
Multiplies by the inverse of the scalar t.
|
Nonmember Operations
Matrix3D operator *(const Matrix3D& m1, const Matrix3D& m2); |
Returns the product of the matrices m1 and m2.
|
Matrix3D operator *(const Matrix3D& m, float t); |
Returns the product of the matrix m and the scalar t.
|
Matrix3D operator /(const Matrix3D& m, float t); |
Returns the product of the matrix m and the inverse of the scalar t.
|
Vector3D operator *(const Matrix3D& m, const Vector3D& v); |
Returns the product of the matrix m and the column vector v.
|
Vector3D operator *(const Matrix3D& m, const Point3D& p); |
Returns the product of the matrix m and the column vector p.
|
Vector3D operator *(const Vector3D& v, const Matrix3D& m); |
Returns the product of the row vector v and the matrix m.
|
Vector3D operator *(const Point3D& p, const Matrix3D& m); |
Returns the product of the row vector p and the matrix m.
|
bool operator ==(const Matrix3D& m1, const Matrix3D& m2); |
Returns a boolean value indicating the equality of the two matrices m1 and m2.
|
bool operator !=(const Matrix3D& m1, const Matrix3D& m2); |
Returns a boolean value indicating the inequality of the two matrices m1 and m2.
|
float Determinant(const Matrix3D& m); |
Returns the determinant of the matrix m.
|
Matrix3D Inverse(const Matrix3D& m); |
Returns the inverse of the matrix m. If m is singular, then the result is undefined.
|
Matrix3D Adjugate(const Matrix3D& m); |
Returns the adjugate of the matrix m.
|
Matrix3D Transpose(const Matrix3D& m); |
Returns the transpose of the matrix m.
|
See Also
Matrix4D
Transform4D
|