public final class Matrices2x2F extends Object
Functions over Matrix2x2F values.
See "Mathematics for 3D Game Programming and Computer Graphics" 2nd Ed for the derivations of most of the code in this class (ISBN: 1-58450-277-0).
| Modifier and Type | Method | Description |
|---|---|---|
static Matrix2x2F |
add(Matrix2x2F m0,
Matrix2x2F m1) |
Add the matrices
m0 and m1. |
static Vector2F |
column0(Matrix2x2F m) |
|
static Vector2F |
column1(Matrix2x2F m) |
|
static double |
determinant(Matrix2x2F m) |
Calculate the determinant of the matrix
m. |
static Matrix2x2F |
identity() |
The identity matrix.
|
static Optional<Matrix2x2F> |
invert(Matrix2x2F m) |
Calculate the inverse of the matrix
m. |
static Matrix2x2F |
multiply(Matrix2x2F m0,
Matrix2x2F m1) |
Multiply the matrices
m0 and m1. |
static Vector2F |
multiplyVectorPost(Matrix2x2F m,
Vector2F v) |
Multiply the vector
v by the matrix m. |
static Matrix2x2F |
ofColumns(Vector2F c0,
Vector2F c1) |
Construct a matrix from the column vectors
(c0, c1). |
static Matrix2x2F |
ofRows(Vector2F r0,
Vector2F r1) |
Construct a matrix from the row vectors
(r0, r1). |
static Matrix2x2F |
ofScale(double x,
double y) |
Construct a matrix that will scale by
(x, y). |
static Vector2F |
row0(Matrix2x2F m) |
|
static Vector2F |
row1(Matrix2x2F m) |
|
static Matrix2x2F |
scale(Matrix2x2F m,
double r) |
Scale the matrix
m by r. |
static Matrix2x2F |
subtract(Matrix2x2F m0,
Matrix2x2F m1) |
Subtract the matrices
m0 and m1. |
static double |
trace(Matrix2x2F m) |
Return the trace of the matrix
m. |
static Matrix2x2F |
transpose(Matrix2x2F m) |
Calculate the transpose of the matrix
m. |
static Matrix2x2F |
withColumn(Matrix2x2F m,
int column,
float r0,
float r1) |
Set the column
column of m to (r0, r1). |
static Matrix2x2F |
withRow(Matrix2x2F m,
int row,
float c0,
float c1) |
Set the row
row of m to (c0, c1). |
static Matrix2x2F |
zero() |
The zero matrix.
|
public static Matrix2x2F add(Matrix2x2F m0, Matrix2x2F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 + m1public static double determinant(Matrix2x2F m)
m.m - The matrixmpublic static Optional<Matrix2x2F> invert(Matrix2x2F m)
m.m - The matrixm, or nothing if no inverse existspublic static Matrix2x2F multiply(Matrix2x2F m0, Matrix2x2F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 * m1public static Vector2F multiplyVectorPost(Matrix2x2F m, Vector2F v)
Multiply the vector v by the matrix m.
This is post multiplication.
m - The matrixv - The vectorm * vpublic static Matrix2x2F ofColumns(Vector2F c0, Vector2F c1)
(c0, c1).c0 - The column 0c1 - The column 1public static Matrix2x2F ofRows(Vector2F r0, Vector2F r1)
(r0, r1).r0 - The row 0r1 - The row 1public static Matrix2x2F ofScale(double x, double y)
(x, y).x - The X scaling valuey - The Y scaling valuepublic static Vector2F row0(Matrix2x2F m)
m - The matrixpublic static Vector2F row1(Matrix2x2F m)
m - The matrixpublic static Vector2F column0(Matrix2x2F m)
m - The matrixpublic static Vector2F column1(Matrix2x2F m)
m - The matrixpublic static Matrix2x2F scale(Matrix2x2F m, double r)
m by r.m - The matrixr - The scale factorm * rpublic static Matrix2x2F subtract(Matrix2x2F m0, Matrix2x2F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 - m1public static double trace(Matrix2x2F m)
m. The trace is defined as the sum
of the diagonal elements of the matrix.m - The matrixpublic static Matrix2x2F transpose(Matrix2x2F m)
m.m - The matrixmpublic static Matrix2x2F withColumn(Matrix2x2F m, int column, float r0, float r1)
column of m to (r0, r1).m - The matrixcolumn - The column index in the range [0, 1]
* @param r0 The value of row 0 in the columnr1 - The value of row 1 in the columnpublic static Matrix2x2F withRow(Matrix2x2F m, int row, float c0, float c1)
row of m to (c0, c1).m - The matrixrow - The row index in the range [0, 1]c0 - The value of column 0 in the rowc1 - The value of column 1 in the rowpublic static Matrix2x2F zero()
public static Matrix2x2F identity()
Copyright © 2017 <code@io7m.com> http://io7m.com