Class Matrix3x2d
 All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Matrix3x2dc
 Direct Known Subclasses:
Matrix3x2dStack
m00 m10 m20
m01 m11 m21
 Author:
 Kai Burjack
 See Also:
 Serialized Form

Field Summary

Constructor Summary
ConstructorDescriptionCreate a newMatrix3x2d
and set it toidentity
.Matrix3x2d(double m00, double m01, double m10, double m11, double m20, double m21)
Create a new 3x2 matrix using the supplied double values.Matrix3x2d(DoubleBuffer buffer)
Create a newMatrix3x2d
by reading its 6 double components from the givenDoubleBuffer
at the buffer's current position.Matrix3x2d(Matrix2dc mat)
Create a newMatrix3x2d
by setting its left 2x2 submatrix to the values of the givenMatrix2dc
and the rest to identity.Matrix3x2d(Matrix2fc mat)
Create a newMatrix3x2d
by setting its left 2x2 submatrix to the values of the givenMatrix2fc
and the rest to identity.Matrix3x2d(Matrix3x2dc mat)
Create a newMatrix3x2d
and make it a copy of the given matrix. 
Method Summary
Modifier and TypeMethodDescriptionclone()
double
Return the determinant of this matrix.boolean
boolean
equals(Matrix3x2dc m, double delta)
Compare the matrix elements ofthis
matrix with the given matrix using the givendelta
and return whether all of them are equal within a maximum difference ofdelta
.double[]
get(double[] arr)
Store this matrix into the supplied double array in columnmajor order.double[]
get(double[] arr, int offset)
Store this matrix into the supplied double array in columnmajor order at the given offset.get(int index, ByteBuffer buffer)
Store this matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.get(int index, DoubleBuffer buffer)
Store this matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.get(ByteBuffer buffer)
Store this matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.get(DoubleBuffer buffer)
Store this matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.get(Matrix3x2d dest)
Get the current values ofthis
matrix and store them intodest
.double[]
get3x3(double[] arr)
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the supplied float array.double[]
get3x3(double[] arr, int offset)
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the supplied float array at the given offset.get3x3(int index, ByteBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.get3x3(int index, DoubleBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.get3x3(ByteBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.get3x3(DoubleBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.double[]
get4x4(double[] arr)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the supplied float array.double[]
get4x4(double[] arr, int offset)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the supplied float array at the given offset.get4x4(int index, ByteBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.get4x4(int index, DoubleBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.get4x4(ByteBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.get4x4(DoubleBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.getToAddress(long address)
Store this matrix in columnmajor order at the given offheap address.int
hashCode()
identity()
Set this matrix to the identity.invert()
Invert this matrix by assuming a third row in this matrix of(0, 0, 1)
.invert(Matrix3x2d dest)
Invert thethis
matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result indest
.boolean
isFinite()
double
m00()
Return the value of the matrix element at column 0 and row 0.double
m01()
Return the value of the matrix element at column 0 and row 1.double
m10()
Return the value of the matrix element at column 1 and row 0.double
m11()
Return the value of the matrix element at column 1 and row 1.double
m20()
Return the value of the matrix element at column 2 and row 0.double
m21()
Return the value of the matrix element at column 2 and row 1.mul(Matrix3x2dc right)
Multiply this matrix by the suppliedright
matrix by assuming a third row in both matrices of(0, 0, 1)
.mul(Matrix3x2dc right, Matrix3x2d dest)
Multiply this matrix by the suppliedright
matrix by assuming a third row in both matrices of(0, 0, 1)
and store the result indest
.mulLocal(Matrix3x2dc left)
Premultiply this matrix by the suppliedleft
matrix and store the result inthis
.mulLocal(Matrix3x2dc left, Matrix3x2d dest)
Premultiply this matrix by the suppliedleft
matrix and store the result indest
.normalizedPositiveX(Vector2d dir)
Obtain the direction of+X
before the transformation represented bythis
orthogonal matrix is applied.normalizedPositiveY(Vector2d dir)
Obtain the direction of+Y
before the transformation represented bythis
orthogonal matrix is applied.Obtain the position that gets transformed to the origin bythis
matrix.Obtain the direction of+X
before the transformation represented bythis
matrix is applied.Obtain the direction of+Y
before the transformation represented bythis
matrix is applied.void
readExternal(ObjectInput in)
rotate(double ang)
Apply a rotation transformation to this matrix by rotating the given amount of radians.rotate(double ang, Matrix3x2d dest)
Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result indest
.rotateAbout(double ang, double x, double y)
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)
.rotateAbout(double ang, double x, double y, Matrix3x2d dest)
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)
and store the result indest
.rotateLocal(double ang)
Premultiply a rotation to this matrix by rotating the given amount of radians.rotateLocal(double ang, Matrix3x2d dest)
Premultiply a rotation to this matrix by rotating the given amount of radians and store the result indest
.Apply a rotation transformation to this matrix that rotates the given normalizedfromDir
direction vector to point along the normalizedtoDir
.rotateTo(Vector2dc fromDir, Vector2dc toDir, Matrix3x2d dest)
Apply a rotation transformation to this matrix that rotates the given normalizedfromDir
direction vector to point along the normalizedtoDir
, and store the result indest
.rotation(double angle)
Set this matrix to a rotation matrix which rotates the given radians.scale(double xy)
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyz
factor.scale(double x, double y)
Apply scaling to this matrix by scaling the base axes by the given x and y factors.scale(double x, double y, Matrix3x2d dest)
Apply scaling to this matrix by scaling the unit axes by the given x and y and store the result indest
.scale(double xy, Matrix3x2d dest)
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxy
factor and store the result indest
.Apply scaling to this matrix by scaling the base axes by the givenxy
factors.scale(Vector2dc xy, Matrix3x2d dest)
Apply scaling to this matrix by scaling the base axes by the givenxy
factors and store the result indest
.Apply scaling to this matrix by scaling the base axes by the givenxy
factors.scale(Vector2fc xy, Matrix3x2d dest)
Apply scaling to this matrix by scaling the base axes by the givenxy
factors and store the result indest
.scaleAround(double factor, double ox, double oy)
Apply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin.scaleAround(double sx, double sy, double ox, double oy)
Apply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin.scaleAround(double sx, double sy, double ox, double oy, Matrix3x2d dest)
Apply scaling tothis
matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin, and store the result indest
.scaleAround(double factor, double ox, double oy, Matrix3x2d dest)
Apply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin, and store the result indest
.scaleAroundLocal(double factor, double ox, double oy)
Premultiply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin.scaleAroundLocal(double sx, double sy, double sz, double ox, double oy, double oz)
Premultiply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin.scaleAroundLocal(double sx, double sy, double ox, double oy, Matrix3x2d dest)
Premultiply scaling tothis
matrix by scaling the base axes by the given sx and sy factors while using the given(ox, oy)
as the scaling origin, and store the result indest
.scaleAroundLocal(double factor, double ox, double oy, Matrix3x2d dest)
Premultiply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin, and store the result indest
.scaleLocal(double xy)
Premultiply scaling to this matrix by scaling the base axes by the given xy factor.scaleLocal(double x, double y)
Premultiply scaling to this matrix by scaling the base axes by the given x and y factors.scaleLocal(double x, double y, Matrix3x2d dest)
Premultiply scaling tothis
matrix by scaling the base axes by the given x and y factors and store the result indest
.scaleLocal(double xy, Matrix3x2d dest)
Premultiply scaling tothis
matrix by scaling the two base axes by the givenxy
factor, and store the result indest
.scaling(double factor)
Set this matrix to be a simple scale matrix, which scales the two base axes uniformly by the given factor.scaling(double x, double y)
Set this matrix to be a simple scale matrix.set(double[] m)
Set the values in this matrix based on the supplied double array.set(double m00, double m01, double m10, double m11, double m20, double m21)
Set the values within this matrix to the supplied double values.set(int index, ByteBuffer buffer)
Set the values of this matrix by reading 6 double values from the givenByteBuffer
in columnmajor order, starting at the specified absolute buffer position/index.set(int index, DoubleBuffer buffer)
Set the values of this matrix by reading 6 double values from the givenDoubleBuffer
in columnmajor order, starting at the specified absolute buffer position/index.set(ByteBuffer buffer)
Set the values of this matrix by reading 6 double values from the givenByteBuffer
in columnmajor order, starting at its current position.set(DoubleBuffer buffer)
Set the values of this matrix by reading 6 double values from the givenDoubleBuffer
in columnmajor order, starting at its current position.Set the left 2x2 submatrix of thisMatrix3x2d
to the givenMatrix2dc
and don't change the other elements.Set the left 2x2 submatrix of thisMatrix3x2d
to the givenMatrix2fc
and don't change the other elements.set(Matrix3x2dc m)
Set the elements of this matrix to the ones inm
.setFromAddress(long address)
Set the values of this matrix by reading 6 double values from offheap memory in columnmajor order, starting at the given address.setTranslation(double x, double y)
Set only the translation components of this matrix(m20, m21)
to the given values(x, y)
.setTranslation(Vector2dc offset)
Set only the translation components of this matrix(m20, m21)
to the given values(offset.x, offset.y)
.setView(double left, double right, double bottom, double top)
Set this matrix to define a "view" transformation that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively.Compute the extents of the coordinate system before this transformation was applied and store the resulting corner coordinates incorner
and the span vectors inxDir
andyDir
.boolean
testAar(double minX, double minY, double maxX, double maxY)
Test whether the given axisaligned rectangle is partly or completely within or outside of the frustum defined bythis
matrix.boolean
testCircle(double x, double y, double r)
Test whether the given circle is partly or completely within or outside of the frustum defined bythis
matrix.boolean
testPoint(double x, double y)
Test whether the given point(x, y)
is within the frustum defined bythis
matrix.toString()
Return a string representation of this matrix.toString(NumberFormat formatter)
Return a string representation of this matrix by formatting the matrix elements with the givenNumberFormat
.Transform/multiply the given vector(x, y, z)
by this matrix and store the result indest
.Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result in that vector.Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result indest
.transformDirection(double x, double y, Vector2d dest)
Transform/multiply the given 2Dvector(x, y)
, as if it was a 3Dvector with z=0, by this matrix and store the result indest
.Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=0, by this matrix and store the result in that vector.transformDirection(Vector2dc v, Vector2d dest)
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=0, by this matrix and store the result indest
.transformPosition(double x, double y, Vector2d dest)
Transform/multiply the given 2Dvector(x, y)
, as if it was a 3Dvector with z=1, by this matrix and store the result indest
.Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=1, by this matrix and store the result in that vector.transformPosition(Vector2dc v, Vector2d dest)
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=1, by this matrix and store the result indest
.translate(double x, double y)
Apply a translation to this matrix by translating by the given number of units in x and y.translate(double x, double y, Matrix3x2d dest)
Apply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.Apply a translation to this matrix by translating by the given number of units in x and y.translate(Vector2dc offset, Matrix3x2d dest)
Apply a translation to this matrix by translating by the given number of units in x and y, and store the result indest
.translateLocal(double x, double y)
Premultiply a translation to this matrix by translating by the given number of units in x and y.translateLocal(double x, double y, Matrix3x2d dest)
Premultiply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.translateLocal(Vector2dc offset)
Premultiply a translation to this matrix by translating by the given number of units in x and y.translateLocal(Vector2dc offset, Matrix3x2d dest)
Premultiply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.translation(double x, double y)
Set this matrix to be a simple translation matrix in a twodimensional coordinate system.translation(Vector2dc offset)
Set this matrix to be a simple translation matrix in a twodimensional coordinate system.Unproject the given window coordinates(winX, winY)
bythis
matrix using the specified viewport.unprojectInv(double winX, double winY, int[] viewport, Vector2d dest)
Unproject the given window coordinates(winX, winY)
bythis
matrix using the specified viewport.view(double left, double right, double bottom, double top)
Apply a "view" transformation to this matrix that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively.view(double left, double right, double bottom, double top, Matrix3x2d dest)
Apply a "view" transformation to this matrix that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively and store the result indest
.double[]
viewArea(double[] area)
Obtain the extents of the view transformation ofthis
matrix and store it inarea
.void
writeExternal(ObjectOutput out)
zero()
Set all values within this matrix to zero.

Field Details

m00
public double m00 
m01
public double m01 
m10
public double m10 
m11
public double m11 
m20
public double m20 
m21
public double m21


Constructor Details

Matrix3x2d
public Matrix3x2d()Create a newMatrix3x2d
and set it toidentity
. 
Matrix3x2d
Create a newMatrix3x2d
by setting its left 2x2 submatrix to the values of the givenMatrix2dc
and the rest to identity. Parameters:
mat
 theMatrix2dc

Matrix3x2d
Create a newMatrix3x2d
by setting its left 2x2 submatrix to the values of the givenMatrix2fc
and the rest to identity. Parameters:
mat
 theMatrix2fc

Matrix3x2d
Create a newMatrix3x2d
and make it a copy of the given matrix. Parameters:
mat
 theMatrix3x2dc
to copy the values from

Matrix3x2d
public Matrix3x2d(double m00, double m01, double m10, double m11, double m20, double m21)Create a new 3x2 matrix using the supplied double values. The order of the parameter is columnmajor, so the first two parameters specify the two elements of the first column. Parameters:
m00
 the value of m00m01
 the value of m01m10
 the value of m10m11
 the value of m11m20
 the value of m20m21
 the value of m21

Matrix3x2d
Create a newMatrix3x2d
by reading its 6 double components from the givenDoubleBuffer
at the buffer's current position.That DoubleBuffer is expected to hold the values in columnmajor order.
The buffer's position will not be changed by this method.
 Parameters:
buffer
 theDoubleBuffer
to read the matrix values from


Method Details

m00
public double m00()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 0 and row 0. Specified by:
m00
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

m01
public double m01()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 0 and row 1. Specified by:
m01
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

m10
public double m10()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 1 and row 0. Specified by:
m10
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

m11
public double m11()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 1 and row 1. Specified by:
m11
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

m20
public double m20()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 2 and row 0. Specified by:
m20
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

m21
public double m21()Description copied from interface:Matrix3x2dc
Return the value of the matrix element at column 2 and row 1. Specified by:
m21
in interfaceMatrix3x2dc
 Returns:
 the value of the matrix element

set
Set the elements of this matrix to the ones inm
. Parameters:
m
 the matrix to copy the elements from Returns:
 this

set
Set the left 2x2 submatrix of thisMatrix3x2d
to the givenMatrix2dc
and don't change the other elements. Parameters:
m
 the 2x2 matrix Returns:
 this

set
Set the left 2x2 submatrix of thisMatrix3x2d
to the givenMatrix2fc
and don't change the other elements. Parameters:
m
 the 2x2 matrix Returns:
 this

mul
Multiply this matrix by the suppliedright
matrix by assuming a third row in both matrices of(0, 0, 1)
.If
M
isthis
matrix andR
theright
matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the transformation of the right matrix will be applied first! Parameters:
right
 the right operand of the matrix multiplication Returns:
 this

mul
Multiply this matrix by the suppliedright
matrix by assuming a third row in both matrices of(0, 0, 1)
and store the result indest
.If
M
isthis
matrix andR
theright
matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the transformation of the right matrix will be applied first! Specified by:
mul
in interfaceMatrix3x2dc
 Parameters:
right
 the right operand of the matrix multiplicationdest
 will hold the result Returns:
 dest

mulLocal
Premultiply this matrix by the suppliedleft
matrix and store the result inthis
.If
M
isthis
matrix andL
theleft
matrix, then the new matrix will beL * M
. So when transforming a vectorv
with the new matrix by usingL * M * v
, the transformation ofthis
matrix will be applied first! Parameters:
left
 the left operand of the matrix multiplication Returns:
 this

mulLocal
Description copied from interface:Matrix3x2dc
Premultiply this matrix by the suppliedleft
matrix and store the result indest
.If
M
isthis
matrix andL
theleft
matrix, then the new matrix will beL * M
. So when transforming a vectorv
with the new matrix by usingL * M * v
, the transformation ofthis
matrix will be applied first! Specified by:
mulLocal
in interfaceMatrix3x2dc
 Parameters:
left
 the left operand of the matrix multiplicationdest
 the destination matrix, which will hold the result Returns:
 dest

set
Set the values within this matrix to the supplied double values. The result looks like this:m00, m10, m20
m01, m11, m21 Parameters:
m00
 the new value of m00m01
 the new value of m01m10
 the new value of m10m11
 the new value of m11m20
 the new value of m20m21
 the new value of m21 Returns:
 this

set
Set the values in this matrix based on the supplied double array. The result looks like this:0, 2, 4
1, 3, 5
This method only uses the first 6 values, all others are ignored. Parameters:
m
 the array to read the matrix values from Returns:
 this

determinant
public double determinant()Return the determinant of this matrix. Specified by:
determinant
in interfaceMatrix3x2dc
 Returns:
 the determinant

invert
Invert this matrix by assuming a third row in this matrix of(0, 0, 1)
. Returns:
 this

invert
Invert thethis
matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result indest
. Specified by:
invert
in interfaceMatrix3x2dc
 Parameters:
dest
 will hold the result Returns:
 dest

translation
Set this matrix to be a simple translation matrix in a twodimensional coordinate system.The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation.
In order to apply a translation via to an already existing transformation matrix, use
translate()
instead. Parameters:
x
 the units to translate in xy
 the units to translate in y Returns:
 this
 See Also:
translate(double, double)

translation
Set this matrix to be a simple translation matrix in a twodimensional coordinate system.The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation.
In order to apply a translation via to an already existing transformation matrix, use
translate()
instead. Parameters:
offset
 the translation Returns:
 this
 See Also:
translate(Vector2dc)

setTranslation
Set only the translation components of this matrix(m20, m21)
to the given values(x, y)
.To build a translation matrix instead, use
translation(double, double)
. To apply a translation to another matrix, usetranslate(double, double)
. Parameters:
x
 the offset to translate in xy
 the offset to translate in y Returns:
 this
 See Also:
translation(double, double)
,translate(double, double)

setTranslation
Set only the translation components of this matrix(m20, m21)
to the given values(offset.x, offset.y)
.To build a translation matrix instead, use
translation(Vector2dc)
. To apply a translation to another matrix, usetranslate(Vector2dc)
. Parameters:
offset
 the new translation to set Returns:
 this
 See Also:
translation(Vector2dc)
,translate(Vector2dc)

translate
Apply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beM * T
. So when transforming a vectorv
with the new matrix by usingM * T * v
, the translation will be applied first!In order to set the matrix to a translation transformation without postmultiplying it, use
translation(double, double)
. Specified by:
translate
in interfaceMatrix3x2dc
 Parameters:
x
 the offset to translate in xy
 the offset to translate in ydest
 will hold the result Returns:
 dest
 See Also:
translation(double, double)

translate
Apply a translation to this matrix by translating by the given number of units in x and y.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beM * T
. So when transforming a vectorv
with the new matrix by usingM * T * v
, the translation will be applied first!In order to set the matrix to a translation transformation without postmultiplying it, use
translation(double, double)
. Parameters:
x
 the offset to translate in xy
 the offset to translate in y Returns:
 this
 See Also:
translation(double, double)

translate
Apply a translation to this matrix by translating by the given number of units in x and y, and store the result indest
.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beM * T
. So when transforming a vectorv
with the new matrix by usingM * T * v
, the translation will be applied first!In order to set the matrix to a translation transformation without postmultiplying it, use
translation(Vector2dc)
. Specified by:
translate
in interfaceMatrix3x2dc
 Parameters:
offset
 the offset to translatedest
 will hold the result Returns:
 dest
 See Also:
translation(Vector2dc)

translate
Apply a translation to this matrix by translating by the given number of units in x and y.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beM * T
. So when transforming a vectorv
with the new matrix by usingM * T * v
, the translation will be applied first!In order to set the matrix to a translation transformation without postmultiplying it, use
translation(Vector2dc)
. Parameters:
offset
 the offset to translate Returns:
 this
 See Also:
translation(Vector2dc)

translateLocal
Premultiply a translation to this matrix by translating by the given number of units in x and y.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beT * M
. So when transforming a vectorv
with the new matrix by usingT * M * v
, the translation will be applied last!In order to set the matrix to a translation transformation without premultiplying it, use
translation(Vector2dc)
. Parameters:
offset
 the number of units in x and y by which to translate Returns:
 this
 See Also:
translation(Vector2dc)

translateLocal
Premultiply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beT * M
. So when transforming a vectorv
with the new matrix by usingT * M * v
, the translation will be applied last!In order to set the matrix to a translation transformation without premultiplying it, use
translation(Vector2dc)
. Specified by:
translateLocal
in interfaceMatrix3x2dc
 Parameters:
offset
 the number of units in x and y by which to translatedest
 will hold the result Returns:
 dest
 See Also:
translation(Vector2dc)

translateLocal
Premultiply a translation to this matrix by translating by the given number of units in x and y and store the result indest
.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beT * M
. So when transforming a vectorv
with the new matrix by usingT * M * v
, the translation will be applied last!In order to set the matrix to a translation transformation without premultiplying it, use
translation(double, double)
. Specified by:
translateLocal
in interfaceMatrix3x2dc
 Parameters:
x
 the offset to translate in xy
 the offset to translate in ydest
 will hold the result Returns:
 dest
 See Also:
translation(double, double)

translateLocal
Premultiply a translation to this matrix by translating by the given number of units in x and y.If
M
isthis
matrix andT
the translation matrix, then the new matrix will beT * M
. So when transforming a vectorv
with the new matrix by usingT * M * v
, the translation will be applied last!In order to set the matrix to a translation transformation without premultiplying it, use
translation(double, double)
. Parameters:
x
 the offset to translate in xy
 the offset to translate in y Returns:
 this
 See Also:
translation(double, double)

toString
Return a string representation of this matrix.This method creates a new
DecimalFormat
on every invocation with the format string "0.000E0;
". 
toString
Return a string representation of this matrix by formatting the matrix elements with the givenNumberFormat
. Parameters:
formatter
 theNumberFormat
used to format the matrix values with Returns:
 the string representation

get
Get the current values ofthis
matrix and store them intodest
.This is the reverse method of
set(Matrix3x2dc)
and allows to obtain intermediate calculation results when chaining multiple transformations. Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
dest
 the destination matrix Returns:
 dest
 See Also:
set(Matrix3x2dc)

get
Store this matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer at which the matrix is stored, use
get(int, DoubleBuffer)
, taking the absolute position as parameter. Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get(int, DoubleBuffer)

get
Store this matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer.
 Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the DoubleBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

get
Store this matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get(int, ByteBuffer)
, taking the absolute position as parameter. Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get(int, ByteBuffer)

get
Store this matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
 Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the ByteBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

get3x3
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer at which the matrix is stored, use
get3x3(int, DoubleBuffer)
, taking the absolute position as parameter. Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get3x3(int, DoubleBuffer)

get3x3
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer.
 Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the DoubleBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

get3x3
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get3x3(int, ByteBuffer)
, taking the absolute position as parameter. Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get3x3(int, ByteBuffer)

get3x3
Store this matrix as an equivalent 3x3 matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
 Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the ByteBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

get4x4
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
at the current bufferposition
.This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer at which the matrix is stored, use
get4x4(int, DoubleBuffer)
, taking the absolute position as parameter. Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get4x4(int, DoubleBuffer)

get4x4
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedDoubleBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer.
 Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the DoubleBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

get4x4
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedByteBuffer
at the current bufferposition
.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get4x4(int, ByteBuffer)
, taking the absolute position as parameter. Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
buffer
 will receive the values of this matrix in columnmajor order at its current position Returns:
 the passed in buffer
 See Also:
get4x4(int, ByteBuffer)

get4x4
Store this matrix as an equivalent 4x4 matrix in columnmajor order into the suppliedByteBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
 Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
index
 the absolute position into the ByteBufferbuffer
 will receive the values of this matrix in columnmajor order Returns:
 the passed in buffer

getToAddress
Description copied from interface:Matrix3x2dc
Store this matrix in columnmajor order at the given offheap address.This method will throw an
UnsupportedOperationException
when JOML is used with `Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.
 Specified by:
getToAddress
in interfaceMatrix3x2dc
 Parameters:
address
 the offheap address where to store this matrix Returns:
 this

get
public double[] get(double[] arr, int offset)Store this matrix into the supplied double array in columnmajor order at the given offset. Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values intooffset
 the offset into the array Returns:
 the passed in array

get
public double[] get(double[] arr)Store this matrix into the supplied double array in columnmajor order.In order to specify an explicit offset into the array, use the method
get(double[], int)
. Specified by:
get
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values into Returns:
 the passed in array
 See Also:
get(double[], int)

get3x3
public double[] get3x3(double[] arr, int offset)Store this matrix as an equivalent 3x3 matrix in columnmajor order into the supplied float array at the given offset. Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values intooffset
 the offset into the array Returns:
 the passed in array

get3x3
public double[] get3x3(double[] arr)Store this matrix as an equivalent 3x3 matrix in columnmajor order into the supplied float array.In order to specify an explicit offset into the array, use the method
get3x3(double[], int)
. Specified by:
get3x3
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values into Returns:
 the passed in array
 See Also:
get3x3(double[], int)

get4x4
public double[] get4x4(double[] arr, int offset)Store this matrix as an equivalent 4x4 matrix in columnmajor order into the supplied float array at the given offset. Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values intooffset
 the offset into the array Returns:
 the passed in array

get4x4
public double[] get4x4(double[] arr)Store this matrix as an equivalent 4x4 matrix in columnmajor order into the supplied float array.In order to specify an explicit offset into the array, use the method
get4x4(double[], int)
. Specified by:
get4x4
in interfaceMatrix3x2dc
 Parameters:
arr
 the array to write the matrix values into Returns:
 the passed in array
 See Also:
get4x4(double[], int)

set
Set the values of this matrix by reading 6 double values from the givenDoubleBuffer
in columnmajor order, starting at its current position.The DoubleBuffer is expected to contain the values in columnmajor order.
The position of the DoubleBuffer will not be changed by this method.
 Parameters:
buffer
 the DoubleBuffer to read the matrix values from in columnmajor order Returns:
 this

set
Set the values of this matrix by reading 6 double values from the givenByteBuffer
in columnmajor order, starting at its current position.The ByteBuffer is expected to contain the values in columnmajor order.
The position of the ByteBuffer will not be changed by this method.
 Parameters:
buffer
 the ByteBuffer to read the matrix values from in columnmajor order Returns:
 this

set
Set the values of this matrix by reading 6 double values from the givenDoubleBuffer
in columnmajor order, starting at the specified absolute buffer position/index.The DoubleBuffer is expected to contain the values in columnmajor order.
The position of the DoubleBuffer will not be changed by this method.
 Parameters:
index
 the absolute position into the DoubleBufferbuffer
 the DoubleBuffer to read the matrix values from in columnmajor order Returns:
 this

set
Set the values of this matrix by reading 6 double values from the givenByteBuffer
in columnmajor order, starting at the specified absolute buffer position/index.The ByteBuffer is expected to contain the values in columnmajor order.
The position of the ByteBuffer will not be changed by this method.
 Parameters:
index
 the absolute position into the ByteBufferbuffer
 the ByteBuffer to read the matrix values from in columnmajor order Returns:
 this

setFromAddress
Set the values of this matrix by reading 6 double values from offheap memory in columnmajor order, starting at the given address.This method will throw an
UnsupportedOperationException
when JOML is used with `Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.
 Parameters:
address
 the offheap memory address to read the matrix values from in columnmajor order Returns:
 this

zero
Set all values within this matrix to zero. Returns:
 this

identity
Set this matrix to the identity. Returns:
 this

scale
Apply scaling to this matrix by scaling the unit axes by the given x and y and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Specified by:
scale
in interfaceMatrix3x2dc
 Parameters:
x
 the factor of the x componenty
 the factor of the y componentdest
 will hold the result Returns:
 dest

scale
Apply scaling to this matrix by scaling the base axes by the given x and y factors.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Parameters:
x
 the factor of the x componenty
 the factor of the y component Returns:
 this

scale
Apply scaling to this matrix by scaling the base axes by the givenxy
factors.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Parameters:
xy
 the factors of the x and y component, respectively Returns:
 this

scale
Apply scaling to this matrix by scaling the base axes by the givenxy
factors and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Specified by:
scale
in interfaceMatrix3x2dc
 Parameters:
xy
 the factors of the x and y component, respectivelydest
 will hold the result Returns:
 dest

scale
Apply scaling to this matrix by scaling the base axes by the givenxy
factors.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Parameters:
xy
 the factors of the x and y component, respectively Returns:
 this

scale
Apply scaling to this matrix by scaling the base axes by the givenxy
factors and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Specified by:
scale
in interfaceMatrix3x2dc
 Parameters:
xy
 the factors of the x and y component, respectivelydest
 will hold the result Returns:
 dest

scale
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxy
factor and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Specified by:
scale
in interfaceMatrix3x2dc
 Parameters:
xy
 the factor for the two componentsdest
 will hold the result Returns:
 dest
 See Also:
scale(double, double, Matrix3x2d)

scale
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyz
factor.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first! Parameters:
xy
 the factor for the two components Returns:
 this
 See Also:
scale(double, double)

scaleLocal
Description copied from interface:Matrix3x2dc
Premultiply scaling tothis
matrix by scaling the base axes by the given x and y factors and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last! Specified by:
scaleLocal
in interfaceMatrix3x2dc
 Parameters:
x
 the factor of the x componenty
 the factor of the y componentdest
 will hold the result Returns:
 dest

scaleLocal
Premultiply scaling to this matrix by scaling the base axes by the given x and y factors.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last! Parameters:
x
 the factor of the x componenty
 the factor of the y component Returns:
 this

scaleLocal
Description copied from interface:Matrix3x2dc
Premultiply scaling tothis
matrix by scaling the two base axes by the givenxy
factor, and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last! Specified by:
scaleLocal
in interfaceMatrix3x2dc
 Parameters:
xy
 the factor to scale all two base axes bydest
 will hold the result Returns:
 dest

scaleLocal
Premultiply scaling to this matrix by scaling the base axes by the given xy factor.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last! Parameters:
xy
 the factor of the x and y component Returns:
 this

scaleAround
Apply scaling tothis
matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin, and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy, dest).scale(sx, sy).translate(ox, oy)
 Specified by:
scaleAround
in interfaceMatrix3x2dc
 Parameters:
sx
 the scaling factor of the x componentsy
 the scaling factor of the y componentox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origindest
 will hold the result Returns:
 dest

scaleAround
Apply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy).scale(sx, sy).translate(ox, oy)
 Parameters:
sx
 the scaling factor of the x componentsy
 the scaling factor of the y componentox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origin Returns:
 this

scaleAround
Apply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin, and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy, dest).scale(factor).translate(ox, oy)
 Specified by:
scaleAround
in interfaceMatrix3x2dc
 Parameters:
factor
 the scaling factor for all three axesox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origindest
 will hold the result Returns:
 this

scaleAround
Apply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beM * S
. So when transforming a vectorv
with the new matrix by usingM * S * v
, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy).scale(factor).translate(ox, oy)
 Parameters:
factor
 the scaling factor for all axesox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origin Returns:
 this

scaleAroundLocal
Description copied from interface:Matrix3x2dc
Premultiply scaling tothis
matrix by scaling the base axes by the given sx and sy factors while using the given(ox, oy)
as the scaling origin, and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2d().translate(ox, oy).scale(sx, sy).translate(ox, oy).mul(this, dest)
 Specified by:
scaleAroundLocal
in interfaceMatrix3x2dc
 Parameters:
sx
 the scaling factor of the x componentsy
 the scaling factor of the y componentox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origindest
 will hold the result Returns:
 dest

scaleAroundLocal
Description copied from interface:Matrix3x2dc
Premultiply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin, and store the result indest
.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2d().translate(ox, oy).scale(factor).translate(ox, oy).mul(this, dest)
 Specified by:
scaleAroundLocal
in interfaceMatrix3x2dc
 Parameters:
factor
 the scaling factor for all three axesox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origindest
 will hold the result Returns:
 this

scaleAroundLocal
public Matrix3x2d scaleAroundLocal(double sx, double sy, double sz, double ox, double oy, double oz)Premultiply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)
as the scaling origin.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2d().translate(ox, oy).scale(sx, sy).translate(ox, oy).mul(this, this)
 Parameters:
sx
 the scaling factor of the x componentsy
 the scaling factor of the y componentsz
 the scaling factor of the z componentox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling originoz
 the z coordinate of the scaling origin Returns:
 this

scaleAroundLocal
Premultiply scaling to this matrix by scaling the base axes by the givenfactor
while using(ox, oy)
as the scaling origin.If
M
isthis
matrix andS
the scaling matrix, then the new matrix will beS * M
. So when transforming a vectorv
with the new matrix by usingS * M * v
, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2d().translate(ox, oy).scale(factor).translate(ox, oy).mul(this, this)
 Parameters:
factor
 the scaling factor for all three axesox
 the x coordinate of the scaling originoy
 the y coordinate of the scaling origin Returns:
 this

scaling
Set this matrix to be a simple scale matrix, which scales the two base axes uniformly by the given factor.The resulting matrix can be multiplied against another transformation matrix to obtain an additional scaling.
In order to postmultiply a scaling transformation directly to a matrix, use
scale()
instead. Parameters:
factor
 the scale factor in x and y Returns:
 this
 See Also:
scale(double)

scaling
Set this matrix to be a simple scale matrix. Parameters:
x
 the scale in xy
 the scale in y Returns:
 this

rotation
Set this matrix to a rotation matrix which rotates the given radians.The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation, use
rotate()
instead. Parameters:
angle
 the angle in radians Returns:
 this
 See Also:
rotate(double)

transform
Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result in that vector. Specified by:
transform
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transform and to hold the final result Returns:
 v
 See Also:
Vector3d.mul(Matrix3x2dc)

transform
Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)
and store the result indest
. Specified by:
transform
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transformdest
 will contain the result Returns:
 dest
 See Also:
Vector3d.mul(Matrix3x2dc, Vector3d)

transform
Transform/multiply the given vector(x, y, z)
by this matrix and store the result indest
. Specified by:
transform
in interfaceMatrix3x2dc
 Parameters:
x
 the x component of the vector to transformy
 the y component of the vector to transformz
 the z component of the vector to transformdest
 will contain the result Returns:
 dest

transformPosition
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=1, by this matrix and store the result in that vector.The given 2Dvector is treated as a 3Dvector with its zcomponent being 1.0, so it will represent a position/location in 2Dspace rather than a direction.
In order to store the result in another vector, use
transformPosition(Vector2dc, Vector2d)
. Specified by:
transformPosition
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transform and to hold the final result Returns:
 v
 See Also:
transformPosition(Vector2dc, Vector2d)
,transform(Vector3d)

transformPosition
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=1, by this matrix and store the result indest
.The given 2Dvector is treated as a 3Dvector with its zcomponent being 1.0, so it will represent a position/location in 2Dspace rather than a direction.
In order to store the result in the same vector, use
transformPosition(Vector2d)
. Specified by:
transformPosition
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transformdest
 will hold the result Returns:
 dest
 See Also:
transformPosition(Vector2d)
,transform(Vector3dc, Vector3d)

transformPosition
Transform/multiply the given 2Dvector(x, y)
, as if it was a 3Dvector with z=1, by this matrix and store the result indest
.The given 2Dvector is treated as a 3Dvector with its zcomponent being 1.0, so it will represent a position/location in 2Dspace rather than a direction.
In order to store the result in the same vector, use
transformPosition(Vector2d)
. Specified by:
transformPosition
in interfaceMatrix3x2dc
 Parameters:
x
 the x component of the vector to transformy
 the y component of the vector to transformdest
 will hold the result Returns:
 dest
 See Also:
transformPosition(Vector2d)
,transform(Vector3dc, Vector3d)

transformDirection
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=0, by this matrix and store the result in that vector.The given 2Dvector is treated as a 3Dvector with its zcomponent being
0.0
, so it will represent a direction in 2Dspace rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in another vector, use
transformDirection(Vector2dc, Vector2d)
. Specified by:
transformDirection
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transform and to hold the final result Returns:
 v
 See Also:
transformDirection(Vector2dc, Vector2d)

transformDirection
Transform/multiply the given 2Dvector, as if it was a 3Dvector with z=0, by this matrix and store the result indest
.The given 2Dvector is treated as a 3Dvector with its zcomponent being
0.0
, so it will represent a direction in 2Dspace rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in the same vector, use
transformDirection(Vector2d)
. Specified by:
transformDirection
in interfaceMatrix3x2dc
 Parameters:
v
 the vector to transform and to hold the final resultdest
 will hold the result Returns:
 dest
 See Also:
transformDirection(Vector2d)

transformDirection
Transform/multiply the given 2Dvector(x, y)
, as if it was a 3Dvector with z=0, by this matrix and store the result indest
.The given 2Dvector is treated as a 3Dvector with its zcomponent being
0.0
, so it will represent a direction in 2Dspace rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in the same vector, use
transformDirection(Vector2d)
. Specified by:
transformDirection
in interfaceMatrix3x2dc
 Parameters:
x
 the x component of the vector to transformy
 the y component of the vector to transformdest
 will hold the result Returns:
 dest
 See Also:
transformDirection(Vector2d)

writeExternal
 Specified by:
writeExternal
in interfaceExternalizable
 Throws:
IOException

readExternal
 Specified by:
readExternal
in interfaceExternalizable
 Throws:
IOException

rotate
Apply a rotation transformation to this matrix by rotating the given amount of radians.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Parameters:
ang
 the angle in radians Returns:
 this

rotate
Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result indest
.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Specified by:
rotate
in interfaceMatrix3x2dc
 Parameters:
ang
 the angle in radiansdest
 will hold the result Returns:
 dest

rotateLocal
Premultiply a rotation to this matrix by rotating the given amount of radians and store the result indest
.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beR * M
. So when transforming a vectorv
with the new matrix by usingR * M * v
, the rotation will be applied last!In order to set the matrix to a rotation matrix without premultiplying the rotation transformation, use
rotation()
.Reference: http://en.wikipedia.org
 Specified by:
rotateLocal
in interfaceMatrix3x2dc
 Parameters:
ang
 the angle in radians to rotatedest
 will hold the result Returns:
 dest
 See Also:
rotation(double)

rotateLocal
Premultiply a rotation to this matrix by rotating the given amount of radians.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beR * M
. So when transforming a vectorv
with the new matrix by usingR * M * v
, the rotation will be applied last!In order to set the matrix to a rotation matrix without premultiplying the rotation transformation, use
rotation()
.Reference: http://en.wikipedia.org
 Parameters:
ang
 the angle in radians to rotate Returns:
 this
 See Also:
rotation(double)

rotateAbout
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)
.This method is equivalent to calling:
translate(x, y).rotate(ang).translate(x, y)
If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Parameters:
ang
 the angle in radiansx
 the x component of the rotation centery
 the y component of the rotation center Returns:
 this
 See Also:
translate(double, double)
,rotate(double)

rotateAbout
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)
and store the result indest
.This method is equivalent to calling:
translate(x, y, dest).rotate(ang).translate(x, y)
If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Specified by:
rotateAbout
in interfaceMatrix3x2dc
 Parameters:
ang
 the angle in radiansx
 the x component of the rotation centery
 the y component of the rotation centerdest
 will hold the result Returns:
 dest
 See Also:
translate(double, double, Matrix3x2d)
,rotate(double, Matrix3x2d)

rotateTo
Apply a rotation transformation to this matrix that rotates the given normalizedfromDir
direction vector to point along the normalizedtoDir
, and store the result indest
.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Specified by:
rotateTo
in interfaceMatrix3x2dc
 Parameters:
fromDir
 the normalized direction which should be rotate to point alongtoDir
toDir
 the normalized destination directiondest
 will hold the result Returns:
 dest

rotateTo
Apply a rotation transformation to this matrix that rotates the given normalizedfromDir
direction vector to point along the normalizedtoDir
.If
M
isthis
matrix andR
the rotation matrix, then the new matrix will beM * R
. So when transforming a vectorv
with the new matrix by usingM * R * v
, the rotation will be applied first! Parameters:
fromDir
 the normalized direction which should be rotate to point alongtoDir
toDir
 the normalized destination direction Returns:
 this

view
Apply a "view" transformation to this matrix that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively and store the result indest
.If
M
isthis
matrix andO
the orthographic projection matrix, then the new matrix will beM * O
. So when transforming a vectorv
with the new matrix by usingM * O * v
, the orthographic projection transformation will be applied first! Specified by:
view
in interfaceMatrix3x2dc
 Parameters:
left
 the distance from the center to the left view edgeright
 the distance from the center to the right view edgebottom
 the distance from the center to the bottom view edgetop
 the distance from the center to the top view edgedest
 will hold the result Returns:
 dest
 See Also:
setView(double, double, double, double)

view
Apply a "view" transformation to this matrix that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively.If
M
isthis
matrix andO
the orthographic projection matrix, then the new matrix will beM * O
. So when transforming a vectorv
with the new matrix by usingM * O * v
, the orthographic projection transformation will be applied first! Parameters:
left
 the distance from the center to the left view edgeright
 the distance from the center to the right view edgebottom
 the distance from the center to the bottom view edgetop
 the distance from the center to the top view edge Returns:
 this
 See Also:
setView(double, double, double, double)

setView
Set this matrix to define a "view" transformation that maps the given(left, bottom)
and(right, top)
corners to(1, 1)
and(1, 1)
respectively. Parameters:
left
 the distance from the center to the left view edgeright
 the distance from the center to the right view edgebottom
 the distance from the center to the bottom view edgetop
 the distance from the center to the top view edge Returns:
 this
 See Also:
view(double, double, double, double)

origin
Obtain the position that gets transformed to the origin bythis
matrix. This can be used to get the position of the "camera" from a given view transformation matrix.This method is equivalent to the following code:
Matrix3x2d inv = new Matrix3x2d(this).invert(); inv.transform(origin.set(0, 0));
 Specified by:
origin
in interfaceMatrix3x2dc
 Parameters:
origin
 will hold the position transformed to the origin Returns:
 origin

viewArea
public double[] viewArea(double[] area)Obtain the extents of the view transformation ofthis
matrix and store it inarea
. This can be used to determine which region of the screen (i.e. the NDC space) is covered by the view. Specified by:
viewArea
in interfaceMatrix3x2dc
 Parameters:
area
 will hold the view area as[minX, minY, maxX, maxY]
 Returns:
 area

positiveX
Description copied from interface:Matrix3x2dc
Obtain the direction of+X
before the transformation represented bythis
matrix is applied.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+X
bythis
matrix.This method is equivalent to the following code:
Matrix3x2d inv = new Matrix3x2d(this).invert(); inv.transformDirection(dir.set(1, 0)).normalize();
Ifthis
is already an orthogonal matrix, then consider usingMatrix3x2dc.normalizedPositiveX(Vector2d)
instead.Reference: http://www.euclideanspace.com
 Specified by:
positiveX
in interfaceMatrix3x2dc
 Parameters:
dir
 will hold the direction of+X
 Returns:
 dir

normalizedPositiveX
Description copied from interface:Matrix3x2dc
Obtain the direction of+X
before the transformation represented bythis
orthogonal matrix is applied. This method only produces correct results ifthis
is an orthogonal matrix.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+X
bythis
matrix.This method is equivalent to the following code:
Matrix3x2d inv = new Matrix3x2d(this).transpose(); inv.transformDirection(dir.set(1, 0));
Reference: http://www.euclideanspace.com
 Specified by:
normalizedPositiveX
in interfaceMatrix3x2dc
 Parameters:
dir
 will hold the direction of+X
 Returns:
 dir

positiveY
Description copied from interface:Matrix3x2dc
Obtain the direction of+Y
before the transformation represented bythis
matrix is applied.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Y
bythis
matrix.This method is equivalent to the following code:
Matrix3x2d inv = new Matrix3x2d(this).invert(); inv.transformDirection(dir.set(0, 1)).normalize();
Ifthis
is already an orthogonal matrix, then consider usingMatrix3x2dc.normalizedPositiveY(Vector2d)
instead.Reference: http://www.euclideanspace.com
 Specified by:
positiveY
in interfaceMatrix3x2dc
 Parameters:
dir
 will hold the direction of+Y
 Returns:
 dir

normalizedPositiveY
Description copied from interface:Matrix3x2dc
Obtain the direction of+Y
before the transformation represented bythis
orthogonal matrix is applied. This method only produces correct results ifthis
is an orthogonal matrix.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Y
bythis
matrix.This method is equivalent to the following code:
Matrix3x2d inv = new Matrix3x2d(this).transpose(); inv.transformDirection(dir.set(0, 1));
Reference: http://www.euclideanspace.com
 Specified by:
normalizedPositiveY
in interfaceMatrix3x2dc
 Parameters:
dir
 will hold the direction of+Y
 Returns:
 dir

unproject
Unproject the given window coordinates(winX, winY)
bythis
matrix using the specified viewport.This method first converts the given window coordinates to normalized device coordinates in the range
[1..1]
and then transforms those NDC coordinates by the inverse ofthis
matrix.As a necessary computation step for unprojecting, this method computes the inverse of
this
matrix. In order to avoid computing the matrix inverse with every invocation, the inverse ofthis
matrix can be built once outside usinginvert(Matrix3x2d)
and then the methodunprojectInv()
can be invoked on it. Specified by:
unproject
in interfaceMatrix3x2dc
 Parameters:
winX
 the xcoordinate in window coordinates (pixels)winY
 the ycoordinate in window coordinates (pixels)viewport
 the viewport described by[x, y, width, height]
dest
 will hold the unprojected position Returns:
 dest
 See Also:
unprojectInv(double, double, int[], Vector2d)
,invert(Matrix3x2d)

unprojectInv
Unproject the given window coordinates(winX, winY)
bythis
matrix using the specified viewport.This method differs from
unproject()
in that it assumes thatthis
is already the inverse matrix of the original projection matrix. It exists to avoid recomputing the matrix inverse with every invocation. Specified by:
unprojectInv
in interfaceMatrix3x2dc
 Parameters:
winX
 the xcoordinate in window coordinates (pixels)winY
 the ycoordinate in window coordinates (pixels)viewport
 the viewport described by[x, y, width, height]
dest
 will hold the unprojected position Returns:
 dest
 See Also:
unproject(double, double, int[], Vector2d)

span
Compute the extents of the coordinate system before this transformation was applied and store the resulting corner coordinates incorner
and the span vectors inxDir
andyDir
.That means, given the maximum extents of the coordinate system between
[1..+1]
in all dimensions, this method returns one corner and the length and direction of the two base axis vectors in the coordinate system before this transformation is applied, which transforms into the corner coordinates[1, +1]
. Parameters:
corner
 will hold one corner of the spanxDir
 will hold the direction and length of the span along the positive X axisyDir
 will hold the direction and length of the span along the positive Y axis Returns:
 this

testPoint
public boolean testPoint(double x, double y)Description copied from interface:Matrix3x2dc
Test whether the given point(x, y)
is within the frustum defined bythis
matrix.This method assumes
this
matrix to be a transformation from any arbitrary coordinate system/spaceM
into standard OpenGL clip space and tests whether the given point with the coordinates(x, y, z)
given in spaceM
is within the clip space.Reference: Fast Extraction of Viewing Frustum Planes from the WorldViewProjection Matrix
 Specified by:
testPoint
in interfaceMatrix3x2dc
 Parameters:
x
 the xcoordinate of the pointy
 the ycoordinate of the point Returns:
true
if the given point is inside the frustum;false
otherwise

testCircle
public boolean testCircle(double x, double y, double r)Description copied from interface:Matrix3x2dc
Test whether the given circle is partly or completely within or outside of the frustum defined bythis
matrix.This method assumes
this
matrix to be a transformation from any arbitrary coordinate system/spaceM
into standard OpenGL clip space and tests whether the given sphere with the coordinates(x, y, z)
given in spaceM
is within the clip space.Reference: Fast Extraction of Viewing Frustum Planes from the WorldViewProjection Matrix
 Specified by:
testCircle
in interfaceMatrix3x2dc
 Parameters:
x
 the xcoordinate of the circle's centery
 the ycoordinate of the circle's centerr
 the circle's radius Returns:
true
if the given circle is partly or completely inside the frustum;false
otherwise

testAar
public boolean testAar(double minX, double minY, double maxX, double maxY)Description copied from interface:Matrix3x2dc
Test whether the given axisaligned rectangle is partly or completely within or outside of the frustum defined bythis
matrix. The rectangle is specified via its min and max corner coordinates.This method assumes
this
matrix to be a transformation from any arbitrary coordinate system/spaceM
into standard OpenGL clip space and tests whether the given axisaligned rectangle with its minimum corner coordinates(minX, minY, minZ)
and maximum corner coordinates(maxX, maxY, maxZ)
given in spaceM
is within the clip space.Reference: Efficient View Frustum Culling
Reference: Fast Extraction of Viewing Frustum Planes from the WorldViewProjection Matrix Specified by:
testAar
in interfaceMatrix3x2dc
 Parameters:
minX
 the xcoordinate of the minimum cornerminY
 the ycoordinate of the minimum cornermaxX
 the xcoordinate of the maximum cornermaxY
 the ycoordinate of the maximum corner Returns:
true
if the axisaligned box is completely or partly inside of the frustum;false
otherwise

hashCode
public int hashCode() 
equals

equals
Description copied from interface:Matrix3x2dc
Compare the matrix elements ofthis
matrix with the given matrix using the givendelta
and return whether all of them are equal within a maximum difference ofdelta
.Please note that this method is not used by any data structure such as
ArrayList
HashSet
orHashMap
and their operations, such asArrayList.contains(Object)
orHashSet.remove(Object)
, since those data structures only use theObject.equals(Object)
andObject.hashCode()
methods. Specified by:
equals
in interfaceMatrix3x2dc
 Parameters:
m
 the other matrixdelta
 the allowed maximum difference Returns:
true
whether all of the matrix elements are equal;false
otherwise

isFinite
public boolean isFinite()Description copied from interface:Matrix3x2dc
Determine whether all matrix elements are finite floatingpoint values, that is, they are notNaN
and notinfinity
. Specified by:
isFinite
in interfaceMatrix3x2dc
 Returns:
true
if all components are finite floatingpoint values;false
otherwise

clone
 Overrides:
clone
in classObject
 Throws:
CloneNotSupportedException
