Clearable
, EpsilonComparable<Matrix3D>
, GeometricallyComparable<Matrix3D>
, GeometryObject<Matrix3D>
, Settable<Matrix3D>
, Transformable
, Matrix3DBasics
, Matrix3DReadOnly
public class Matrix3D extends java.lang.Object implements Matrix3DBasics, GeometryObject<Matrix3D>
Matrix3D
is a 3-by-3 matrix used for general linear applications.
This version of 3D matrix uses double precision fields to save the value of each component. It is meant for garbage free usage.
Constructor | Description |
---|---|
Matrix3D() |
Creates a new 3D matrix with all its coefficients set to zero.
|
Matrix3D(double[] matrixArray) |
Creates a new 3D matrix and initializes it from the given array.
|
Matrix3D(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Creates a new 3D matrix and initializes it from the given 9 coefficients.
|
Matrix3D(Matrix3DReadOnly other) |
Creates a new 3D matrix that is the same as
other . |
Modifier and Type | Method | Description |
---|---|---|
void |
add(Matrix3DReadOnly other) |
Performs a per-component addition onto the coefficients of this matrix.
|
void |
add(Matrix3DReadOnly matrix1,
Matrix3DReadOnly matrix2) |
Sets this matrix coefficients to the per-component sum of the two given matrices.
|
void |
applyInverseTransform(Transform transform) |
Transform this using the inverse of the given
transform . |
void |
applyTransform(Transform transform) |
Transform this using the given
transform . |
boolean |
epsilonEquals(Matrix3D other,
double epsilon) |
Tests on a per coefficient basis if this matrix is equal to the given
other to an
epsilon . |
boolean |
equals(java.lang.Object object) |
Tests if the given
object 's class is the same as this, in which case the method returns
Matrix3DReadOnly.equals(Matrix3DReadOnly) , it returns false otherwise or if the object is
null . |
void |
fill(double scalar) |
Sets all the coefficients of this matrix to be equal to
scalar . |
boolean |
geometricallyEquals(Matrix3D other,
double epsilon) |
Two 3D matrices are considered geometrically equal if they are epsilon equal.
|
double |
getM00() |
Gets the 1st row 1st column coefficient of this matrix.
|
double |
getM01() |
Gets the 1st row 2nd column coefficient of this matrix.
|
double |
getM02() |
Gets the 1st row 3rd column coefficient of this matrix.
|
double |
getM10() |
Gets the 2nd row 1st column coefficient of this matrix.
|
double |
getM11() |
Gets the 2nd row 2nd column coefficient of this matrix.
|
double |
getM12() |
Gets the 2nd row 3rd column coefficient of this matrix.
|
double |
getM20() |
Gets the 3rd row 1st column coefficient of this matrix.
|
double |
getM21() |
Gets the 3rd row 2nd column coefficient of this matrix.
|
double |
getM22() |
Gets the 3rd row 3rd column coefficient of this matrix.
|
int |
hashCode() |
Calculates and returns a hash code value from the value of each component of this matrix.
|
void |
inverseTransform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transforms to the given 3D matrix
matrixOriginal by this
matrix and stores the result in matrixTransformed . |
void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfTransformInXYPlane) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
void |
inverseTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
void |
inverseTransform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform to the vector part the given 4D vector
vectorOriginal by this matrix and stores the result in vectorTransformed . |
void |
invert() |
Invert this matrix.
|
void |
multiply(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyInvertOther(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyInvertOther(RotationMatrixReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyInvertOther(RotationScaleMatrixReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyInvertThis(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyOuter() |
Sets this matrix to be equal to its outer-product.
|
void |
multiplyTransposeBoth(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyTransposeOther(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
multiplyTransposeThis(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
negate() |
Negates each component of this matrix.
|
void |
normalize() |
Orthonormalization of this matrix using the
Gram-Schmidt method.
|
void |
preMultiply(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyInvertOther(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyInvertOther(RotationMatrixReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyInvertOther(RotationScaleMatrixReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyInvertThis(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyTransposeBoth(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyTransposeOther(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
preMultiplyTransposeThis(Matrix3DReadOnly other) |
Performs a matrix multiplication on this.
|
void |
scale(double scalar) |
Performs a per-component scale on this matrix.
|
void |
scaleColumn(int column,
double scalar) |
Scales the components of the
column th column of this matrix. |
void |
scaleColumns(double scalarColumn0,
double scalarColumn1,
double scalarColumn2) |
Scales individually each column of this matrix.
|
void |
scaleM00(double scalar) |
Scales the value of the 1st row 1st column component.
|
void |
scaleM01(double scalar) |
Scales the value of the 1st row 2nd column component.
|
void |
scaleM02(double scalar) |
Scales the value of the 1st row 3rd column component.
|
void |
scaleM10(double scalar) |
Scales the value of the 2nd row 1st column component.
|
void |
scaleM11(double scalar) |
Scales the value of the 2nd row 2nd column component.
|
void |
scaleM12(double scalar) |
Scales the value of the 2nd row 3rd column component.
|
void |
scaleM20(double scalar) |
Scales the value of the 3rd row 1st column component.
|
void |
scaleM21(double scalar) |
Scales the value of the 3rd row 2nd column component.
|
void |
scaleM22(double scalar) |
Scales the value of the 3rd row 3rd column component.
|
void |
scaleRow(int row,
double scalar) |
Scales the components of the
row th row of this matrix. |
void |
scaleRows(double scalarRow0,
double scalarRow1,
double scalarRow2) |
Scales individually each row of this matrix.
|
void |
set(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Sets the 9 coefficients of this matrix to the given ones.
|
void |
set(Matrix3D other) |
Copies the values from
other into this object. |
void |
setAndInvert(Matrix3DReadOnly other) |
Set this matrix to the inverse of the other matrix.
|
void |
setAndMultiplyOuter(Matrix3DReadOnly other) |
Sets this matrix to be equal to the outer-product of
other . |
void |
setAndNegate(Matrix3DReadOnly other) |
Sets this matrix to
other and then calls negate() . |
void |
setAndNormalize(Matrix3DReadOnly other) |
Sets this matrix to equal the other matrix and then normalizes this, see
normalize() . |
void |
setAndTranspose(Matrix3DReadOnly other) |
Sets this matrix to equal the other matrix and then transposes this.
|
void |
setColumn(int column,
double[] columnArray) |
Sets the
column th column components to the values contained in the given array
columnArray . |
void |
setColumn(int column,
double x,
double y,
double z) |
Sets the
column th column components to the given values. |
void |
setColumn(int column,
Tuple3DReadOnly columnValues) |
Sets the
column th column components to the values contained in the given tuple
columnValues . |
void |
setElement(int row,
int column,
double value) |
Sets the value of the component of this matrix located by its row and column indices.
|
void |
setM00(double m00) |
Sets the value of the 1st row 1st column component.
|
void |
setM01(double m01) |
Sets the value of the 1st row 2nd column component.
|
void |
setM02(double m02) |
Sets the value of the 1st row 3rd column component.
|
void |
setM10(double m10) |
Sets the value of the 2nd row 1st column component.
|
void |
setM11(double m11) |
Sets the value of the 2nd row 2nd column component.
|
void |
setM12(double m12) |
Sets the value of the 2nd row 3rd column component.
|
void |
setM20(double m20) |
Sets the value of the 3rd row 1st column component.
|
void |
setM21(double m21) |
Sets the value of the 3rd row 2nd column component.
|
void |
setM22(double m22) |
Sets the value of the 3rd row 3rd column component.
|
void |
setRow(int row,
double[] rowArray) |
Sets the
row th row components to the values contained in the given array
rowArray . |
void |
setRow(int row,
double x,
double y,
double z) |
Sets the
row th row components to the given values. |
void |
setRow(int row,
Tuple3DReadOnly rowValues) |
Sets the
row th row components to the values contained in the given tuple
rowValues . |
void |
setToPitchMatrix(double pitch) |
Sets this matrix to represent a counter clockwise rotation around the y-axis of an angle
pitch . |
void |
setToRollMatrix(double roll) |
Sets this matrix to represent a counter clockwise rotation around the x-axis of an angle
roll . |
void |
setToTildeForm(Tuple3DReadOnly tuple) |
Converts a vector to tilde form (matrix implementation of cross product).
|
void |
setToYawMatrix(double yaw) |
Sets this matrix to represent to represent a counter clockwise rotation around the z-axis of an
angle
yaw . |
void |
setToZero() |
Sets all the coefficients of this matrix to zero.
|
void |
sub(Matrix3DReadOnly other) |
Performs a per-component subtraction onto the coefficients of this matrix.
|
void |
sub(Matrix3DReadOnly matrix1,
Matrix3DReadOnly matrix2) |
Sets this matrix coefficients to the per-component difference of the two given matrices.
|
java.lang.String |
toString() |
Provides a
String representation of this matrix as follows: m00, m01, m02 m10, m11, m12 m20, m21, m22 |
void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the given 3D matrix
matrixOriginal by this matrix and stores the result in
matrixTransformed . |
void |
transpose() |
Transposes this matrix: m = mT.
|
containsNaN, set, set, set, set, set, setIdentity, setToNaN
addTransform, addTransform, checkIfMatrix2D, checkIfRotationMatrix, determinant, epsilonEquals, equals, get, get, get, get, getColumn, getColumn, getElement, getRow, getRow, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isIdentity, isIdentity, isMatrix2D, isMatrix2D, isMatrixSkewSymmetric, isMatrixSkewSymmetric, isRotationMatrix, isRotationMatrix, transform, transform, transform, transform, transform, transform, transform, transform, transform
public Matrix3D()
public Matrix3D(double[] matrixArray)
/ matrixArray[0] matrixArray[1] matrixArray[2] \ this = | matrixArray[3] matrixArray[4] matrixArray[5] | \ matrixArray[6] matrixArray[7] matrixArray[8] /
matrixArray
- the array containing the values for this matrix. Not modified.public Matrix3D(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
m00
- the 1st row 1st column coefficient for this matrix.m01
- the 1st row 2nd column coefficient for this matrix.m02
- the 1st row 3rd column coefficient for this matrix.m10
- the 2nd row 1st column coefficient for this matrix.m11
- the 2nd row 2nd column coefficient for this matrix.m12
- the 2nd row 3rd column coefficient for this matrix.m20
- the 3rd row 1st column coefficient for this matrix.m21
- the 3rd row 2nd column coefficient for this matrix.m22
- the 3rd row 3rd column coefficient for this matrix.public Matrix3D(Matrix3DReadOnly other)
other
.other
- the other 3D matrix to copy the values from. Not modified.public void setToZero()
public void transpose()
public void set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
set
in interface Matrix3DBasics
m00
- the new 1st row 1st column coefficient for this matrix.m01
- the new 1st row 2nd column coefficient for this matrix.m02
- the new 1st row 3rd column coefficient for this matrix.m10
- the new 2nd row 1st column coefficient for this matrix.m11
- the new 2nd row 2nd column coefficient for this matrix.m12
- the new 2nd row 3rd column coefficient for this matrix.m20
- the new 3rd row 1st column coefficient for this matrix.m21
- the new 3rd row 2nd column coefficient for this matrix.m22
- the new 3rd row 3rd column coefficient for this matrix.public void set(Matrix3D other)
other
into this object.public void setToTildeForm(Tuple3DReadOnly tuple)
/ 0 -z y \ this = | z 0 -x | \ -y x 0 /
tuple
- the tuple to use to create its tilde form. Not modified.public void setAndMultiplyOuter(Matrix3DReadOnly other)
other
.
this = other * otherT
other
- the other matrix used for this operation. Not modified.public void setAndInvert(Matrix3DReadOnly other)
this = other-1
other
- the other matrix. Not modified.SingularMatrixException
- if the matrix is not invertible.public void setAndNormalize(Matrix3DReadOnly other)
normalize()
.other
- the other matrix used to update this matrix. Not modified.public void setAndTranspose(Matrix3DReadOnly other)
this = otherT
other
- the other matrix used to update this matrix. Not modified.public void setAndNegate(Matrix3DReadOnly other)
other
and then calls negate()
.other
- the other matrix used to update this matrix. Not modified.public void setToYawMatrix(double yaw)
yaw
.
/ cos(yaw) -sin(yaw) 0 \ this = | sin(yaw) cos(yaw) 0 | \ 0 0 1 /
yaw
- the angle to rotate about the z-axis.public void setToPitchMatrix(double pitch)
pitch
.
/ cos(pitch) 0 sin(pitch) \ this = | 0 1 0 | \ -sin(pitch) 0 cos(pitch) /
pitch
- the angle to rotate about the y-axis.public void setToRollMatrix(double roll)
roll
.
/ 1 0 0 \ this = | 0 cos(roll) -sin(roll) | \ 0 sin(roll) cos(roll) /
roll
- the angle to rotate about the x-axis.public void add(Matrix3DReadOnly other)
this = this + other
other
- the other matrix to use for the addition. Not modified.public void add(Matrix3DReadOnly matrix1, Matrix3DReadOnly matrix2)
this = matrix1 + matrix2
matrix1
- the first term of the addition. Not modified.matrix2
- the second term of the addition. Not modified.public void sub(Matrix3DReadOnly other)
this = this - other
other
- the other matrix to use for the subtraction. Not modified.public void sub(Matrix3DReadOnly matrix1, Matrix3DReadOnly matrix2)
this = matrix1 - matrix2
matrix1
- the first term of the addition. Not modified.matrix2
- the second term of the addition. Not modified.public void fill(double scalar)
scalar
.
/ scalar scalar scalar \ this = | scalar scalar scalar | \ scalar scalar scalar /
scalar
- the scalar value to fill this matrix with.public void scale(double scalar)
this = scalar * this
scalar
- the scale factor to use on the components of this matrix.public void scaleRows(double scalarRow0, double scalarRow1, double scalarRow2)
/ scalarRow0 * m00 scalarRow0 * m01 scalarRow0 * m02 \ this = | scalarRow1 * m10 scalarRow1 * m11 scalarRow1 * m12 | \ scalarRow2 * m20 scalarRow2 * m21 scalarRow2 * m22 /
This operation is equivalent to pre-multiplying this matrix, i.e. this = D * this, by the following diagonal matrix D:
/ scaleRow0 0 0 \ D = | 0 scaleRow1 0 | \ 0 0 scaleRow2 /
scalarRow0
- the scale factor to use on the components of the 1st row.scalarRow1
- the scale factor to use on the components of the 2nd row.scalarRow2
- the scale factor to use on the components of the 3rd row.public void scaleColumns(double scalarColumn0, double scalarColumn1, double scalarColumn2)
/ scalarColumn0 * m00 scalarColumn1 * m01 scalarColumn2 * m02 \ this = | scalarColumn0 * m10 scalarColumn1 * m11 scalarColumn2 * m12 | \ scalarColumn0 * m20 scalarColumn1 * m21 scalarColumn2 * m22 /
This operation is equivalent to multiplying this matrix, i.e. this = this * D, by the following diagonal matrix D:
/ scalarColumn0 0 0 \ D = | 0 scalarColumn1 0 | \ 0 0 scalarColumn2 /
scalarColumn0
- the scale factor to use on the components of the 1st column.scalarColumn1
- the scale factor to use on the components of the 2nd column.scalarColumn2
- the scale factor to use on the components of the 3rd column.public void multiplyOuter()
this = this * thisT
public void applyTransform(Transform transform)
transform
.
this = R * this * RT
where 'R' is the 3-by-3 matrix representing the rotation part of the transform
.
Note: the transformation of a Matrix3D
strongly differs from the transformation of a
RotationMatrix
.
applyTransform
in interface Transformable
transform
- the transform to use on this. Not modified.public void applyInverseTransform(Transform transform)
transform
.
this = RT * this * R
where 'R' is the 3-by-3 matrix representing the rotation part of the transform
.
Note: the transformation of a Matrix3D
strongly differs from the transformation of a
RotationMatrix
.
applyInverseTransform
in interface Transformable
transform
- the transform to use on this. Not modified.public void invert()
this = this-1
SingularMatrixException
- if the matrix is not invertible.public void normalize()
public void negate()
public void multiply(Matrix3DReadOnly other)
this = this * other
other
- the other matrix to multiply this by. Not modified.public void multiplyTransposeThis(Matrix3DReadOnly other)
this = thisT * other
other
- the other matrix to multiply this by. Not modified.public void multiplyTransposeOther(Matrix3DReadOnly other)
this = this * otherT
other
- the other matrix to multiply this by. Not modified.public void multiplyTransposeBoth(Matrix3DReadOnly other)
this = thisT * otherT
other
- the other matrix to multiply this by. Not modified.public void multiplyInvertThis(Matrix3DReadOnly other)
this = this-1 * other
other
- the other matrix to multiply this by. Not modified.SingularMatrixException
- if this
is not invertible.public void multiplyInvertOther(Matrix3DReadOnly other)
this = this * other-1
other
- the other matrix to multiply this by. Not modified.SingularMatrixException
- if other
is not invertible.public void multiplyInvertOther(RotationMatrixReadOnly other)
this = this * other-1
This operation uses the property:
R-1 = RT
of the rotation matrix preventing to actually compute its inverse.
other
- the other matrix to multiply this by. Not modified.public void multiplyInvertOther(RotationScaleMatrixReadOnly other)
this = this * other-1
This operation uses the property:
(R * S)-1 = S-1 * RT
of the rotation-scale matrix preventing to actually compute its inverse.
other
- the other matrix to multiply this by. Not modified.public void preMultiply(Matrix3DReadOnly other)
this = other * this
other
- the other matrix to multiply this by. Not modified.public void preMultiplyTransposeThis(Matrix3DReadOnly other)
this = other * thisT
other
- the other matrix to multiply this by. Not modified.public void preMultiplyTransposeOther(Matrix3DReadOnly other)
this = otherT * this
other
- the other matrix to multiply this by. Not modified.public void preMultiplyTransposeBoth(Matrix3DReadOnly other)
this = otherT * thisT
other
- the other matrix to multiply this by. Not modified.public void preMultiplyInvertThis(Matrix3DReadOnly other)
this = other * this-1
other
- the other matrix to multiply this by. Not modified.SingularMatrixException
- if this
is not invertible.public void preMultiplyInvertOther(Matrix3DReadOnly other)
this = other-1 * this
other
- the other matrix to multiply this by. Not modified.SingularMatrixException
- if other
is not invertible.public void preMultiplyInvertOther(RotationMatrixReadOnly other)
this = other-1 * this
This operation uses the property:
R-1 = RT
of the rotation matrix preventing to actually compute its inverse.
other
- the other matrix to multiply this by. Not modified.public void preMultiplyInvertOther(RotationScaleMatrixReadOnly other)
this = other-1 * this
This operation uses the property:
(R * S)-1 = S-1 * RT
of the rotation-scale matrix preventing to actually compute its inverse.
other
- the other matrix to multiply this by. Not modified.public void transform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this matrix and stores the result in
matrixTransformed
.
matrixTransformed = this * matrixOriginal * this-1
transform
in interface Matrix3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.public void inverseTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.public void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfTransformInXYPlane)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that this matrix represents a
transformation in the XY plane.public void inverseTransform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
by this matrix and stores the result in vectorTransformed
.
vectorTransformed.s = vectorOriginal.s
vectorTransformed.xyz = this-1 * vectorOriginal.xyz
inverseTransform
in interface Matrix3DReadOnly
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.public void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this
matrix and stores the result in matrixTransformed
.
matrixTransformed = this-1 * matrixOriginal * this-1
inverseTransform
in interface Matrix3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.public void setRow(int row, double[] rowArray)
row
th row components to the values contained in the given array
rowArray
.row
- the index of the row to set the values of.rowArray
- the array containing the new values for the row. Not modified.java.lang.ArrayIndexOutOfBoundsException
- if row
∉ [0, 2].public void setRow(int row, Tuple3DReadOnly rowValues)
row
th row components to the values contained in the given tuple
rowValues
.row
- the index of the row to set the values of.rowValues
- the tuple containing the new values for the row. Not modified.java.lang.ArrayIndexOutOfBoundsException
- if row
∉ [0, 2].public void setRow(int row, double x, double y, double z)
row
th row components to the given values.row
- the index of the row to set the values of.x
- the new value of the first component in the row.y
- the new value of the second component in the row.z
- the new value of the third component in the row.java.lang.ArrayIndexOutOfBoundsException
- if row
∉ [0, 2].public void setColumn(int column, double[] columnArray)
column
th column components to the values contained in the given array
columnArray
.column
- the index of the column to set the values of.columnArray
- the array containing the new values for the column. Not modified.java.lang.ArrayIndexOutOfBoundsException
- if column
∉ [0, 2].public void setColumn(int column, Tuple3DReadOnly columnValues)
column
th column components to the values contained in the given tuple
columnValues
.column
- the index of the column to set the values of.columnValues
- the tuple containing the new values for the column. Not modified.java.lang.ArrayIndexOutOfBoundsException
- if column
∉ [0, 2].public void setColumn(int column, double x, double y, double z)
column
th column components to the given values.column
- the index of the column to set the values of.x
- the new value of the first component in the column.y
- the new value of the second component in the column.z
- the new value of the third component in the column.java.lang.ArrayIndexOutOfBoundsException
- if column
∉ [0, 2].public void scaleRow(int row, double scalar)
row
th row of this matrix.row
- the index of the row to scale.scalar
- the scale factor to apply.java.lang.ArrayIndexOutOfBoundsException
- if row
∉ [0, 2].public void scaleColumn(int column, double scalar)
column
th column of this matrix.column
- the index of the column to scale.scalar
- the scale factor to apply.java.lang.ArrayIndexOutOfBoundsException
- if column
∉ [0, 2].public void setElement(int row, int column, double value)
row
- the index of the component's row.column
- the index of the component's column.value
- the new value of the component.java.lang.ArrayIndexOutOfBoundsException
- if row
∉ [0, 2] or column
∉
[0, 2]public void setM00(double m00)
m00
- the new value of the component.public void setM01(double m01)
m01
- the new value of the component.public void setM02(double m02)
m02
- the new value of the component.public void setM10(double m10)
m10
- the new value of the component.public void setM11(double m11)
m11
- the new value of the component.public void setM12(double m12)
m12
- the new value of the component.public void setM20(double m20)
m20
- the new value of the component.public void setM21(double m21)
m21
- the new value of the component.public void setM22(double m22)
m22
- the new value of the component.public void scaleM00(double scalar)
scalar
- the scale factor to apply.public void scaleM01(double scalar)
scalar
- the scale factor to apply.public void scaleM02(double scalar)
scalar
- the scale factor to apply.public void scaleM10(double scalar)
scalar
- the scale factor to apply.public void scaleM11(double scalar)
scalar
- the scale factor to apply.public void scaleM12(double scalar)
scalar
- the scale factor to apply.public void scaleM20(double scalar)
scalar
- the scale factor to apply.public void scaleM21(double scalar)
scalar
- the scale factor to apply.public void scaleM22(double scalar)
scalar
- the scale factor to apply.public double getM00()
getM00
in interface Matrix3DReadOnly
public double getM01()
getM01
in interface Matrix3DReadOnly
public double getM02()
getM02
in interface Matrix3DReadOnly
public double getM10()
getM10
in interface Matrix3DReadOnly
public double getM11()
getM11
in interface Matrix3DReadOnly
public double getM12()
getM12
in interface Matrix3DReadOnly
public double getM20()
getM20
in interface Matrix3DReadOnly
public double getM21()
getM21
in interface Matrix3DReadOnly
public double getM22()
getM22
in interface Matrix3DReadOnly
public boolean equals(java.lang.Object object)
object
's class is the same as this, in which case the method returns
Matrix3DReadOnly.equals(Matrix3DReadOnly)
, it returns false
otherwise or if the object
is
null
.equals
in class java.lang.Object
object
- the object to compare against this. Not modified.true
if object
and this are exactly equal, false
otherwise.public boolean epsilonEquals(Matrix3D other, double epsilon)
other
to an
epsilon
.epsilonEquals
in interface EpsilonComparable<Matrix3D>
other
- the other matrix to compare against this. Not modified.epsilon
- the tolerance to use when comparing each component.true
if the two matrices are equal, false
otherwise.public boolean geometricallyEquals(Matrix3D other, double epsilon)
This method is equivalent to epsilonEquals(Matrix3D, double)
.
geometricallyEquals
in interface GeometricallyComparable<Matrix3D>
other
- the other matrix to compare against this. Not modified.epsilon
- the tolerance to use when comparing each component.true
if the two matrices are equal, false
otherwise.public java.lang.String toString()
String
representation of this matrix as follows: toString
in class java.lang.Object
String
representing this matrix.public int hashCode()
hashCode
in class java.lang.Object