|
API Links
Developer Links
|
class Matrix4D
Defined in: C4Matrix4D.h
The Matrix4D class encapsulates a 4 × 4 matrix.
Definition
class Matrix4D
Member Functions
Constructor
Matrix4D();
Matrix4D(const Vector4D& c1, const Vector4D& c2, const Vector4D& c3, const Vector4D& c4);
Matrix4D(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13,
float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33);
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.
|
c4 |
The values of the entries residing in fourth column.
|
nij |
The value of the entry residing in row i and column j.
|
Description
The Matrix4D class is used to store a 4 × 4 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 16 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 four vectors c1, c2, c3, and c4, then these vectors initialize the four 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, 2, or 3.
|
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, 2, or 3.
|
Vector4D& operator [](long j); |
Returns a reference to the j-th column of a matrix. j must be 0, 1, 2, or 3.
|
const Vector4D& operator [](long j) const; |
Returns a constant reference to the j-th column of a matrix. j must be 0, 1, 2, or 3.
|
Matrix4D& operator =(const Matrix3D& m); |
Assigns the entries of m to the upper-left 3 × 3 portion of a matrix and assigns the entries of the identity matrix to the fourth row and fourth column.
|
Matrix4D& operator *=(const Matrix4D& m); |
Multiplies by the matrix m.
|
Matrix4D& operator *=(const Matrix3D& m); |
Multiplies by the matrix m. The entries of the fourth row and fourth column of m are assumed to be those of the identity matrix.
|
Nonmember Operations
Matrix4D operator *(const Matrix4D& m1, const Matrix4D& m2); |
Returns the product of the matrices m1 and m2.
|
Matrix4D operator *(const Matrix4D& m1, const Matrix3D& m2); |
Returns the product of the matrices m1 and m2. The entries of the fourth row and fourth column of m2 are assumed to be those of the identity matrix.
|
Vector4D operator *(const Matrix4D& m, const Vector4D& v); |
Returns the product of the matrix m and the column vector v.
|
Vector4D operator *(const Vector4D& v, const Matrix4D& m); |
Returns the prodict of the row vector v and the matrix m.
|
Vector4D operator *(const Matrix4D& m, const Vector3D& v); |
Returns the product of the matrix m and the column vector v. The w component of v is assumed to be 0.
|
Vector4D operator *(const Vector3D& v, const Matrix4D& m); |
Returns the prodict of the row vector v and the matrix m. The w component of v is assumed to be 0.
|
Vector4D operator *(const Matrix4D& m, const Point3D& p); |
Returns the product of the matrix m and the column vector p. The w component of p is assumed to be 1.
|
Vector4D operator *(const Point3D& p, const Matrix4D& m); |
Returns the prodict of the row vector p and the matrix m. The w component of p is assumed to be 1.
|
Vector4D operator *(const Matrix4D& m, const Vector2D& v); |
Returns the product of the matrix m and the column vector v. The z and w components of v are assumed to be 0.
|
Vector4D operator *(const Vector2D& v, const Matrix4D& m); |
Returns the prodict of the row vector v and the matrix m. The z and w components of v are assumed to be 0.
|
Vector4D operator *(const Matrix4D& m, const Point2D& p); |
Returns the product of the matrix m and the column vector p. The z component of p is assumed to be 0, and the w component of p is assumed to be 1.
|
Vector4D operator *(const Point2D& p, const Matrix4D& m); |
Returns the prodict of the row vector p and the matrix m. The z component of p is assumed to be 0, and the w component of p is assumed to be 1.
|
bool operator ==(const Matrix4D& m1, const Matrix4D& m2); |
Returns a boolean value indicating the equality of the two matrices m1 and m2.
|
bool operator !=(const Matrix4D& m1, const Matrix4D& m2); |
Returns a boolean value indicating the inequality of the two matrices m1 and m2.
|
float Determinant(const Matrix4D& m); |
Returns the determinant of the matrix m.
|
Matrix4D Inverse(const Matrix4D& m); |
Returns the inverse of the matrix m. If m is singular, then the result is undefined.
|
Matrix4D Adjugate(const Matrix4D& m); |
Returns the adjugate of the matrix m.
|
Matrix4D Transpose(const Matrix4D& m); |
Returns the transpose of the matrix m.
|
See Also
Transform4D
Matrix3D
Vector3D
Point3D
|