public final class Matrices3x3F extends Object
Functions over Matrix3x3F 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 Matrix3x3F |
add(Matrix3x3F m0,
Matrix3x3F m1) |
Add the matrices
m0 and m1. |
static Vector3F |
column0(Matrix3x3F m) |
|
static Vector3F |
column1(Matrix3x3F m) |
|
static Vector3F |
column2(Matrix3x3F m) |
|
static double |
determinant(Matrix3x3F m) |
Calculate the determinant of the matrix
m. |
static Matrix3x3F |
identity() |
The identity matrix.
|
static Optional<Matrix3x3F> |
invert(Matrix3x3F m) |
Calculate the inverse of the matrix
m. |
static Matrix3x3F |
multiply(Matrix3x3F m0,
Matrix3x3F m1) |
Multiply the matrices
m0 and m1. |
static Vector3F |
multiplyVectorPost(Matrix3x3F m,
Vector3F v) |
Multiply the vector
v by the matrix m. |
static Matrix3x3F |
ofAxisAngle(double axis_x,
double axis_y,
double axis_z,
double angle) |
Construct a matrix that will rotate by
angle radians around the axis (x, y, z). |
static Matrix3x3F |
ofColumns(Vector3F c0,
Vector3F c1,
Vector3F c2) |
Construct a matrix from the column vectors
(c0, c1, c2). |
static Matrix3x3F |
ofRows(Vector3F r0,
Vector3F r1,
Vector3F r2) |
Construct a matrix from the row vectors
(r0, r1, r2). |
static Matrix3x3F |
ofScale(double x,
double y,
double z) |
Construct a matrix that will scale by
(x, y, z). |
static Vector3F |
row0(Matrix3x3F m) |
|
static Vector3F |
row1(Matrix3x3F m) |
|
static Vector3F |
row2(Matrix3x3F m) |
|
static Matrix3x3F |
scale(Matrix3x3F m,
double r) |
Scale the matrix
m by r. |
static Matrix3x3F |
subtract(Matrix3x3F m0,
Matrix3x3F m1) |
Subtract the matrices
m0 and m1. |
static double |
trace(Matrix3x3F m) |
Return the trace of the matrix
m. |
static Matrix3x3F |
transpose(Matrix3x3F m) |
Calculate the transpose of the matrix
m. |
static Matrix3x3F |
withColumn(Matrix3x3F m,
int column,
float r0,
float r1,
float r2) |
Set the column
column of m to (r0, r1, r2). |
static Matrix3x3F |
withRow(Matrix3x3F m,
int row,
float c0,
float c1,
float c2) |
Set the row
row of m to (c0, c1, c2). |
static Matrix3x3F |
zero() |
The zero matrix.
|
public static Matrix3x3F add(Matrix3x3F m0, Matrix3x3F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 + m1public static double determinant(Matrix3x3F m)
m.m - The matrixmpublic static Optional<Matrix3x3F> invert(Matrix3x3F m)
m.m - The matrixm, or nothing if no inverse existspublic static Matrix3x3F multiply(Matrix3x3F m0, Matrix3x3F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 * m1public static Vector3F multiplyVectorPost(Matrix3x3F m, Vector3F v)
Multiply the vector v by the matrix m.
This is post multiplication.
m - The matrixv - The vectorm * vpublic static Matrix3x3F ofColumns(Vector3F c0, Vector3F c1, Vector3F c2)
(c0, c1, c2).c0 - The column 0c1 - The column 1c2 - The column 2public static Matrix3x3F ofRows(Vector3F r0, Vector3F r1, Vector3F r2)
(r0, r1, r2).r0 - The row 0r1 - The row 1r2 - The row 2public static Matrix3x3F ofScale(double x, double y, double z)
(x, y, z).x - The X scaling valuey - The Y scaling valuez - The Z scaling valuepublic static Matrix3x3F ofAxisAngle(double axis_x, double axis_y, double axis_z, double angle)
angle radians around the axis (x, y, z).angle - The angle in radiansaxis_x - The X axis valueaxis_y - The Y axis valueaxis_z - The Z axis valuepublic static Vector3F row0(Matrix3x3F m)
m - The matrixpublic static Vector3F row1(Matrix3x3F m)
m - The matrixpublic static Vector3F row2(Matrix3x3F m)
m - The matrixpublic static Vector3F column0(Matrix3x3F m)
m - The matrixpublic static Vector3F column1(Matrix3x3F m)
m - The matrixpublic static Vector3F column2(Matrix3x3F m)
m - The matrixpublic static Matrix3x3F scale(Matrix3x3F m, double r)
m by r.m - The matrixr - The scale factorm * rpublic static Matrix3x3F subtract(Matrix3x3F m0, Matrix3x3F m1)
m0 and m1.m0 - The left matrixm1 - The right matrixm0 - m1public static double trace(Matrix3x3F m)
m. The trace is defined as the sum
of the diagonal elements of the matrix.m - The matrixpublic static Matrix3x3F transpose(Matrix3x3F m)
m.m - The matrixmpublic static Matrix3x3F withColumn(Matrix3x3F m, int column, float r0, float r1, float r2)
column of m to (r0, r1, r2).m - The matrixcolumn - The column index in the range [0, 2]
* @param r0 The value of row 0 in the columnr1 - The value of row 1 in the columnr2 - The value of row 2 in the columnpublic static Matrix3x3F withRow(Matrix3x3F m, int row, float c0, float c1, float c2)
row of m to (c0, c1, c2).m - The matrixrow - The row index in the range [0, 2]c0 - The value of column 0 in the rowc1 - The value of column 1 in the rowc2 - The value of column 2 in the rowpublic static Matrix3x3F zero()
public static Matrix3x3F identity()
Copyright © 2017 <code@io7m.com> http://io7m.com