matrix2
Contents
Usage
Multipurpose 2*2 matrix type of the format: [0 2] [1 3]
Inheritance
(Global)
Base classes
Derived classes
- None
Reference
Constants
- None
Fields
- float* values;
Constructors
The first constructor creates an empty matrix. The second constructor takes in an 2x2 array of floats to create the matrix. The third constructor takes in another matrix2 and makes another matrix with it. The last constructor takes in an array of float2 and creates a matrix out of it.
- matrix2();
- matrix2(float** vectors);
- matrix2(matrix2 &rhs);
- matrix2(float2* vectors);
Accessors
- None
Methods
The create methods all create a 2x2 matrix for either rotation, scaling, or identity. The rotate takes in a theta for the angle where as the scale takes in a float 2 of the format <x,y>. The create_identity will just return a 2x2 identity matrix. determinant() will calculate and return the determinant. invert() will calculate and return the inverted 2x2 matrix.
- static matrix2* create_rotate(float theta);
- static matrix2* create_scale(float2 scale);
- static matrix2* create_identity();
- float determinant();
- matrix2 invert();
Operators
These are all the overloaded operators for matrix2 which take care of scalar multiplication and matrix addition, subtraction, multiplication and division.
- matrix2 operator+ (matrix2 &rhs);
- matrix2 operator- (matrix2 &rhs);
- matrix2 operator* (float rhs);
- matrix2 operator/ (float rhs);
- matrix2 operator* (matrix2 &rhs);
- float2 operator* (float2 &rhs);
- void operator+= (matrix2 &rhs);
- void operator-= (matrix2 &rhs);
- void operator*= (float rhs);
- void operator/= (float rhs);
- void operator*= (matrix2 &rhs);
- operator float* ();
Global |
---|
geColor · geRandom · geMath.h |
geVector.h(float2 · float3 · float4) · geMatrix.h(matrix2 · matrix3 · matrix4) |