public class Matrix2f extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Matrix2f |
IDENTITY
Identity matrix:
|
float |
M00
Matrix data:
|
float |
M01
Matrix data:
|
float |
M10 |
float |
M11 |
private static long |
serialVersionUID |
static Matrix2f |
ZERO
Zero matrix:
|
Constructor and Description |
---|
Matrix2f()
Constructor, defaults to zero-matrix:
|
Matrix2f(boolean bZero)
If bZero is true, create the zero matrix.
|
Matrix2f(float fAngle)
Create rotation matrices (positive angle - counterclockwise).
|
Matrix2f(float[] afEntry,
boolean bRowMajor)
Create a matrix from an array of numbers.
|
Matrix2f(float fM00,
float fM11)
create a diagonal matrix
|
Matrix2f(float fM00,
float fM01,
float fM10,
float fM11)
input Mrc is in row r, column c.
|
Matrix2f(Matrix2f rkM)
copy constructor
|
Matrix2f(Vector2f[] akV,
boolean bColumns)
Create matrices based on vector input.
|
Matrix2f(Vector2f rkU,
Vector2f rkV)
create a tensor product U*V^T
|
Matrix2f(Vector2f rkU,
Vector2f rkV,
boolean bColumns)
Create matrices based on vector input.
|
Modifier and Type | Method and Description |
---|---|
Matrix2f |
add(float fM00,
float fM01,
float fM10,
float fM11)
Add to this matrix.
|
void |
Add(float fM00,
float fM01,
float fM10,
float fM11)
Deprecated.
|
Matrix2f |
adjoint()
Compute the adjoint of this matrix: this = Adjoint(this)
|
void |
Adjoint()
Deprecated.
|
Matrix2f |
copy(Matrix2f rkM)
Set the values of this.
|
void |
Copy(Matrix2f rkM)
Deprecated.
|
float |
determinant()
Return the determinant of this matrix.
|
float |
Determinant()
Deprecated.
|
void |
eigenDecomposition(Matrix2f rkRot,
Matrix2f rkDiag)
Factor M = R*D*R^T.
|
void |
EigenDecomposition(Matrix2f rkRot,
Matrix2f rkDiag)
Deprecated.
|
Matrix2f |
fromAngle(float fAngle)
Create a rotation matrix from an angle in radians.
|
void |
FromAngle(float fAngle)
Deprecated.
|
float |
get(int iIndex)
Get member access
|
float |
Get(int iIndex)
Deprecated.
|
float |
get(int iRow,
int iCol)
Get member access
|
float |
Get(int iRow,
int iCol)
Deprecated.
|
void |
getColumn(int iCol,
Vector2f kResult)
Get member access
|
void |
GetColumn(int iCol,
Vector2f kResult)
Deprecated.
|
void |
getColumnMajor(float[] afCMajor)
Get member access.
|
void |
GetColumnMajor(float[] afCMajor)
Deprecated.
|
void |
getData(float[] afData)
Get member access.
|
void |
GetData(float[] afData)
Deprecated.
|
Matrix2f |
identity()
make this the identity matrix
|
Matrix2f |
inverse()
Invert a 3x3 using cofactors.
|
void |
Inverse()
Deprecated.
|
static Matrix2f |
inverse(Matrix2f kM)
Invert using cofactors.
|
void |
Inverse(Matrix2f kM)
Deprecated.
|
Matrix2f |
makeDiagonal(float fM00,
float fM11)
Create a diagonal matrix:
|
void |
MakeDiagonal(float fM00,
float fM11)
Deprecated.
|
void |
MakeIdentity()
Deprecated.
|
Matrix2f |
makeTensorProduct(Vector2f rkU,
Vector2f rkV)
create a tensor product U*V^T
|
void |
MakeTensorProduct(Vector2f rkU,
Vector2f rkV)
Deprecated.
|
Matrix2f |
makeZero()
make this the zero matrix
|
void |
MakeZero()
Deprecated.
|
Matrix2f |
mult(Matrix2f kM)
Multiply this matrix to the input matrix: this = this * kM.
|
void |
Mult(Matrix2f kM)
Deprecated.
|
static Matrix2f |
mult(Matrix2f kM1,
Matrix2f kM2)
Multiply this matrix to the input matrix: this = kM1 * kM2.
|
void |
Mult(Matrix2f kM1,
Matrix2f kM2)
Deprecated.
|
Vector2f |
mult(Vector2f kV)
Matrix times vector: Result = this * v
|
void |
mult(Vector2f kV,
Vector2f kResult)
Matrix times vector: Result = this * v
|
void |
Mult(Vector2f kV,
Vector2f kResult)
Deprecated.
|
Matrix2f |
multLeft(Matrix2f kM)
Multiply this matrix to the input matrix: this = kM * this.
|
void |
MultLeft(Matrix2f kM)
Deprecated.
|
Vector2f |
multLeft(Vector2f kV)
matrix times vector: kResult = v^T * this
|
void |
multLeft(Vector2f kV,
Vector2f kResult)
matrix times vector: kResult = v^T * this
|
void |
MultLeft(Vector2f kV,
Vector2f kResult)
Deprecated.
|
Vector2f |
multRight(Vector2f kV)
Matrix times vector: Result = this * v
|
void |
multRight(Vector2f kV,
Vector2f kResult)
Matrix times vector: Result = this * v
|
void |
MultRight(Vector2f kV,
Vector2f kResult)
Deprecated.
|
Matrix2f |
orthonormalize()
The matrix must be a rotation for these functions to be valid.
|
void |
Orthonormalize()
Deprecated.
|
float |
qForm(Vector2f rkU,
Vector2f rkV)
Calculate and return u^T*M*v
|
float |
QForm(Vector2f rkU,
Vector2f rkV)
Deprecated.
|
Matrix2f |
scale(float fScalar)
Multiply this matrix by the scalar input: this = this * fScalar.
|
void |
Scale(float fScalar)
Deprecated.
|
Matrix2f |
set(float fM00,
float fM01,
float fM10,
float fM11)
input Mrc is in row r, column c.
|
void |
Set(float fM00,
float fM01,
float fM10,
float fM11)
Deprecated.
|
Matrix2f |
set(int iIndex,
float fValue) |
void |
Set(int iIndex,
float fValue)
Deprecated.
|
Matrix2f |
set(int iRow,
int iCol,
float fValue)
Set the values of this.
|
void |
Set(int iRow,
int iCol,
float fValue)
Deprecated.
|
Matrix2f |
setColumn(int iCol,
Vector2f kV)
Set member access
|
void |
SetColumn(int iCol,
Vector2f kV)
Deprecated.
|
Matrix2f |
timesTranspose(Matrix2f kM)
Multiply this matrix by transpose of the input matrix: this = this * M^T
|
void |
TimesTranspose(Matrix2f kM)
Deprecated.
|
float |
toAngle()
The matrix must be a rotation.
|
float |
ToAngle()
Deprecated.
|
String |
toString()
Returns a string representation of the matrix values.
|
Matrix2f |
transpose()
Transpose this matrix: this = this^T
|
void |
Transpose()
Deprecated.
|
Matrix2f |
transposeTimes(Matrix2f kM)
Transpose this matrix and multiply by input: this = this^T * M
|
void |
TransposeTimes(Matrix2f kM)
Deprecated.
|
private static final long serialVersionUID
public static final Matrix2f ZERO
public static final Matrix2f IDENTITY
public float M00
public float M01
public float M10
public float M11
public Matrix2f()
public Matrix2f(boolean bZero)
bZero
- when true create zero matrix, when false create identity.public Matrix2f(float fAngle)
fAngle
- rotation angle in radianspublic Matrix2f(float fM00, float fM11)
fM00
- 0-diagonal valuefM11
- 1-diagonal valuepublic Matrix2f(float fM00, float fM01, float fM10, float fM11)
fM00
- matrix[0] entryfM01
- matrix[1] entryfM10
- matrix[2] entryfM11
- matrix[3] entrypublic Matrix2f(float[] afEntry, boolean bRowMajor)
afEntry
- array of values to put in matrixbRowMajor
- when true copy in row major order.public Matrix2f(Matrix2f rkM)
rkM
- matrix to copy.public Matrix2f(Vector2f rkU, Vector2f rkV)
rkU
- U-VectorrkV
- V-Vectorpublic Matrix2f(Vector2f rkU, Vector2f rkV, boolean bColumns)
rkU
- input vector1rkV
- input vector2bColumns
- when true vectors are columns of matrix.public Matrix2f(Vector2f[] akV, boolean bColumns)
akV
- input vector[2]bColumns
- when true vectors are columns of matrix.public final void Add(float fM00, float fM01, float fM10, float fM11)
fM00
- fM01
- fM10
- fM11
- public Matrix2f add(float fM00, float fM01, float fM10, float fM11)
fM00
- fM01
- fM10
- fM11
- public void Adjoint()
public Matrix2f adjoint()
public void Copy(Matrix2f rkM)
rkM
- matrix to copy.public float Determinant()
public float determinant()
public void EigenDecomposition(Matrix2f rkRot, Matrix2f rkDiag)
rkRot
- rkDiag
- public void eigenDecomposition(Matrix2f rkRot, Matrix2f rkDiag)
rkRot
- rkDiag
- public void FromAngle(float fAngle)
fAngle
- rotation angle in radianspublic Matrix2f fromAngle(float fAngle)
fAngle
- rotation angle in radianspublic final float Get(int iIndex)
iIndex
- matrix indexpublic final float get(int iIndex)
iIndex
- matrix indexpublic final float Get(int iRow, int iCol)
iRow
- row-valueiCol
- column-valuepublic final float get(int iRow, int iCol)
iRow
- row-valueiCol
- column-valuepublic void GetColumn(int iCol, Vector2f kResult)
iCol
- column to getkResult
- column vector valuespublic void getColumn(int iCol, Vector2f kResult)
iCol
- column to getkResult
- column vector valuespublic void GetColumnMajor(float[] afCMajor)
afCMajor
- copy matrix into array.public void getColumnMajor(float[] afCMajor)
afCMajor
- copy matrix into array.public void GetData(float[] afData)
afData
- copy matrix into array.public void getData(float[] afData)
afData
- copy matrix into array.public void Inverse()
public Matrix2f inverse()
public void Inverse(Matrix2f kM)
kM
- the matrix to invert. this = kM-1public static Matrix2f inverse(Matrix2f kM)
kM
- the matrix to invert. this = kM-1public void MakeDiagonal(float fM00, float fM11)
fM00
- matrix[0] entryfM11
- matrix[3] entrypublic Matrix2f makeDiagonal(float fM00, float fM11)
fM00
- matrix[0] entryfM11
- matrix[3] entrypublic void MakeIdentity()
public Matrix2f identity()
public void MakeTensorProduct(Vector2f rkU, Vector2f rkV)
rkU
- U-VectorrkV
- V-Vectorpublic Matrix2f makeTensorProduct(Vector2f rkU, Vector2f rkV)
rkU
- U-VectorrkV
- V-Vectorpublic void MakeZero()
public Matrix2f makeZero()
public void Mult(Matrix2f kM)
kM
- input matrixpublic Matrix2f mult(Matrix2f kM)
kM
- input matrixpublic void Mult(Matrix2f kM1, Matrix2f kM2)
kM1
- first input matrixkM2
- second input matrixpublic static Matrix2f mult(Matrix2f kM1, Matrix2f kM2)
kM1
- first input matrixkM2
- second input matrixpublic void Mult(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = this * vpublic void mult(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = this * vpublic Vector2f mult(Vector2f kV)
kV
- vectorkResult
- = this * vpublic void MultLeft(Matrix2f kM)
kM
- input matrixpublic Matrix2f multLeft(Matrix2f kM)
kM
- input matrixpublic void MultLeft(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = v^T * thispublic void multLeft(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = v^T * thispublic Vector2f multLeft(Vector2f kV)
kV
- vectorkResult
- = v^T * thispublic void MultRight(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = this * vpublic void multRight(Vector2f kV, Vector2f kResult)
kV
- vectorkResult
- = this * vpublic Vector2f multRight(Vector2f kV)
kV
- vectorkResult
- = this * vpublic void Orthonormalize()
public Matrix2f orthonormalize()
public float QForm(Vector2f rkU, Vector2f rkV)
rkU
- urkV
- vpublic float qForm(Vector2f rkU, Vector2f rkV)
rkU
- urkV
- vpublic void Scale(float fScalar)
fScalar
- scalar valuepublic Matrix2f scale(float fScalar)
fScalar
- scalar valuepublic final void Set(float fM00, float fM01, float fM10, float fM11)
fM00
- matrix[0] entryfM01
- matrix[1] entryfM10
- matrix[2] entryfM11
- matrix[3] entrypublic Matrix2f set(float fM00, float fM01, float fM10, float fM11)
fM00
- matrix[0] entryfM01
- matrix[1] entryfM10
- matrix[2] entryfM11
- matrix[3] entrypublic void Set(int iIndex, float fValue)
iIndex
- matrix indexpublic Matrix2f set(int iIndex, float fValue)
iIndex
- matrix indexpublic final void Set(int iRow, int iCol, float fValue)
iRow
- row-valueiCol
- column-valuefValue
- matrix[iIndex] new valuepublic Matrix2f set(int iRow, int iCol, float fValue)
iRow
- row-valueiCol
- column-valuefValue
- matrix[iIndex] new valuepublic void SetColumn(int iCol, Vector2f kV)
iCol
- column to setkV
- new column vector valuespublic Matrix2f setColumn(int iCol, Vector2f kV)
iCol
- column to setkV
- new column vector valuespublic void TimesTranspose(Matrix2f kM)
kM
- matrixpublic Matrix2f timesTranspose(Matrix2f kM)
kM
- matrixpublic float ToAngle()
public float toAngle()
public String toString()
public void Transpose()
public Matrix2f transpose()
public void TransposeTimes(Matrix2f kM)
kM
- input matrix