Matrix3x2d

Contains the definition of a 3x2 matrix of doubles, and associated functions to transform it. The matrix is column-major to match OpenGL's interpretation, and it looks like this: <p> m00 m10 m20<br> m01 m11 m21<br>

@author Kai Burjack

struct Matrix3x2d {}

Constructors

this
this(Matrix2d mat)

Create a new {@link Matrix3x2d} by setting its left 2x2 submatrix to the values of the given {@link Matrix2d} and the rest to identity.

this
this(Matrix3x2d mat)

Create a new {@link Matrix3x2d} and make it a copy of the given matrix.

this
this(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 column-major, so the first two parameters specify the two elements of the first column.

Members

Functions

_m00
Matrix3x2d _m00(double m00)

Set the value of the matrix element at column 0 and row 0.

_m01
Matrix3x2d _m01(double m01)

Set the value of the matrix element at column 0 and row 1.

_m10
Matrix3x2d _m10(double m10)

Set the value of the matrix element at column 1 and row 0.

_m11
Matrix3x2d _m11(double m11)

Set the value of the matrix element at column 1 and row 1.

_m20
Matrix3x2d _m20(double m20)

Set the value of the matrix element at column 2 and row 0.

_m21
Matrix3x2d _m21(double m21)

Set the value of the matrix element at column 2 and row 1.

determinant
double determinant()

Return the determinant of this matrix.

equals
bool equals(Matrix3x2d m, double delta)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Matrix3x2d get(Matrix3x2d dest)

Get the current values of <code>this</code> matrix and store them into <code>dest</code>. <p> This is the reverse method of {@link #set(Matrix3x2d)} and allows to obtain intermediate calculation results when chaining multiple transformations.

get
double[] get(double[] arr, int offset)

Store this matrix into the supplied double array in column-major order at the given offset.

get
double[] get(double[] arr)

Store this matrix into the supplied double array in column-major order. <p> In order to specify an explicit offset into the array, use the method {@link #get(double[], int)}.

get3x3
double[] get3x3(double[] arr, int offset)

Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array at the given offset.

get3x3
double[] get3x3(double[] arr)

Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array. <p> In order to specify an explicit offset into the array, use the method {@link #get3x3(double[], int)}.

get4x4
double[] get4x4(double[] arr, int offset)

Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array at the given offset.

get4x4
double[] get4x4(double[] arr)

Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array. <p> In order to specify an explicit offset into the array, use the method {@link #get4x4(double[], int)}.

hashCode
int hashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
identity
Matrix3x2d identity()

Set this matrix to the identity.

invert
Matrix3x2d invert()

Invert this matrix by assuming a third row in this matrix of <code>(0, 0, 1)</code>.

invert
Matrix3x2d invert(Matrix3x2d dest)

Invert the <code>this</code> matrix by assuming a third row in this matrix of <code>(0, 0, 1)</code> and store the result in <code>dest</code>.

isFinite
bool isFinite()
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Matrix3x2d mul(Matrix3x2d right)

Multiply this matrix by the supplied <code>right</code> matrix by assuming a third row in both matrices of <code>(0, 0, 1)</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the <code>right</code> matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the transformation of the right matrix will be applied first!

mul
Matrix3x2d mul(Matrix3x2d right, Matrix3x2d dest)

Multiply this matrix by the supplied <code>right</code> matrix by assuming a third row in both matrices of <code>(0, 0, 1)</code> and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the <code>right</code> matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the transformation of the right matrix will be applied first!

mulLocal
Matrix3x2d mulLocal(Matrix3x2d left)

Pre-multiply this matrix by the supplied <code>left</code> matrix and store the result in <code>this</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the <code>left</code> matrix, then the new matrix will be <code>L * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>L * M * v</code>, the transformation of <code>this</code> matrix will be applied first!

mulLocal
Matrix3x2d mulLocal(Matrix3x2d left, Matrix3x2d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
normalizedPositiveX
Vector2d normalizedPositiveX(Vector2d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
normalizedPositiveY
Vector2d normalizedPositiveY(Vector2d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
origin
Vector2d origin(Vector2d origin)

Obtain the position that gets transformed to the origin by <code>this</code> matrix. This can be used to get the position of the "camera" from a given <i>view</i> transformation matrix. <p> This method is equivalent to the following code: <pre> Matrix3x2d inv = new Matrix3x2d(this).invert(); inv.transform(origin.set(0, 0)); </pre>

positiveX
Vector2d positiveX(Vector2d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
positiveY
Vector2d positiveY(Vector2d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
rotate
Matrix3x2d rotate(double ang)

Apply a rotation transformation to this matrix by rotating the given amount of radians. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code> , the rotation will be applied first!

rotate
Matrix3x2d rotate(double ang, Matrix3x2d dest)

Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first!

rotateAbout
Matrix3x2d 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 <code>(x, y)</code>. <p> This method is equivalent to calling: <code>translate(x, y).rotate(ang).translate(-x, -y)</code> <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first!

rotateAbout
Matrix3x2d 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 <code>(x, y)</code> and store the result in <code>dest</code>. <p> This method is equivalent to calling: <code>translate(x, y, dest).rotate(ang).translate(-x, -y)</code> <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first!

rotateLocal
Matrix3x2d rotateLocal(double ang, Matrix3x2d dest)

Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>R * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>R * M * v</code>, the rotation will be applied last! <p> In order to set the matrix to a rotation matrix without pre-multiplying the rotation transformation, use {@link #rotation(double) rotation()}. <p> Reference: <a href="http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle">http://en.wikipedia.org</a>

rotateLocal
Matrix3x2d rotateLocal(double ang)

Pre-multiply a rotation to this matrix by rotating the given amount of radians. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>R * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>R * M * v</code>, the rotation will be applied last! <p> In order to set the matrix to a rotation matrix without pre-multiplying the rotation transformation, use {@link #rotation(double) rotation()}. <p> Reference: <a href="http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle">http://en.wikipedia.org</a>

rotateTo
Matrix3x2d rotateTo(Vector2d fromDir, Vector2d toDir, Matrix3x2d dest)

Apply a rotation transformation to this matrix that rotates the given normalized <code>fromDir</code> direction vector to point along the normalized <code>toDir</code>, and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first!

rotateTo
Matrix3x2d rotateTo(Vector2d fromDir, Vector2d toDir)

Apply a rotation transformation to this matrix that rotates the given normalized <code>fromDir</code> direction vector to point along the normalized <code>toDir</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix, then the new matrix will be <code>M * R</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the rotation will be applied first!

rotation
Matrix3x2d rotation(double angle)

Set this matrix to a rotation matrix which rotates the given radians. <p> The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation. <p> In order to apply the rotation transformation to an existing transformation, use {@link #rotate(double) rotate()} instead.

scale
Matrix3x2d 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 in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scale
Matrix3x2d scale(double x, double y)

Apply scaling to this matrix by scaling the base axes by the given x and y factors. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scale
Matrix3x2d scale(Vector2d xy)

Apply scaling to this matrix by scaling the base axes by the given <code>xy</code> factors. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scale
Matrix3x2d scale(Vector2d xy, Matrix3x2d dest)

Apply scaling to this matrix by scaling the base axes by the given <code>xy</code> factors and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scale
Matrix3x2d scale(double xy, Matrix3x2d dest)

Apply scaling to this matrix by uniformly scaling the two base axes by the given <code>xy</code> factor and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scale
Matrix3x2d scale(double xy)

Apply scaling to this matrix by uniformly scaling the two base axes by the given <code>xyz</code> factor. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first!

scaleAround
Matrix3x2d scaleAround(double sx, double sy, double ox, double oy, Matrix3x2d dest)

Apply scaling to <code>this</code> matrix by scaling the base axes by the given sx and sy factors while using <code>(ox, oy)</code> as the scaling origin, and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code> , the scaling will be applied first! <p> This method is equivalent to calling: <code>translate(ox, oy, dest).scale(sx, sy).translate(-ox, -oy)</code>

scaleAround
Matrix3x2d 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 <code>(ox, oy)</code> as the scaling origin. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first! <p> This method is equivalent to calling: <code>translate(ox, oy).scale(sx, sy).translate(-ox, -oy)</code>

scaleAround
Matrix3x2d scaleAround(double factor, double ox, double oy, Matrix3x2d dest)

Apply scaling to this matrix by scaling the base axes by the given <code>factor</code> while using <code>(ox, oy)</code> as the scaling origin, and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first! <p> This method is equivalent to calling: <code>translate(ox, oy, dest).scale(factor).translate(-ox, -oy)</code>

scaleAround
Matrix3x2d scaleAround(double factor, double ox, double oy)

Apply scaling to this matrix by scaling the base axes by the given <code>factor</code> while using <code>(ox, oy)</code> as the scaling origin. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first! <p> This method is equivalent to calling: <code>translate(ox, oy).scale(factor).translate(-ox, -oy)</code>

scaleAroundLocal
Matrix3x2d scaleAroundLocal(double sx, double sy, double ox, double oy, Matrix3x2d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
scaleAroundLocal
Matrix3x2d scaleAroundLocal(double factor, double ox, double oy, Matrix3x2d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
scaleAroundLocal
Matrix3x2d scaleAroundLocal(double sx, double sy, double sz, double ox, double oy, double oz)

Pre-multiply scaling to this matrix by scaling the base axes by the given sx and sy factors while using <code>(ox, oy)</code> as the scaling origin. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>S * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>S * M * v</code>, the scaling will be applied last! <p> This method is equivalent to calling: <code>new Matrix3x2d().translate(ox, oy).scale(sx, sy).translate(-ox, -oy).mul(this, this)</code>

scaleAroundLocal
Matrix3x2d scaleAroundLocal(double factor, double ox, double oy)

Pre-multiply scaling to this matrix by scaling the base axes by the given <code>factor</code> while using <code>(ox, oy)</code> as the scaling origin. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>S * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>S * M * v</code>, the scaling will be applied last! <p> This method is equivalent to calling: <code>new Matrix3x2d().translate(ox, oy).scale(factor).translate(-ox, -oy).mul(this, this)</code>

scaleLocal
Matrix3x2d scaleLocal(double x, double y, Matrix3x2d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
scaleLocal
Matrix3x2d scaleLocal(double x, double y)

Pre-multiply scaling to this matrix by scaling the base axes by the given x and y factors. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>S * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>S * M * v</code>, the scaling will be applied last!

scaleLocal
Matrix3x2d scaleLocal(double xy, Matrix3x2d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
scaleLocal
Matrix3x2d scaleLocal(double xy)

Pre-multiply scaling to this matrix by scaling the base axes by the given xy factor. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>S * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>S * M * v</code>, the scaling will be applied last!

scaling
Matrix3x2d scaling(double factor)

Set this matrix to be a simple scale matrix, which scales the two base axes uniformly by the given factor. <p> The resulting matrix can be multiplied against another transformation matrix to obtain an additional scaling. <p> In order to post-multiply a scaling transformation directly to a matrix, use {@link #scale(double) scale()} instead.

scaling
Matrix3x2d scaling(double x, double y)

Set this matrix to be a simple scale matrix.

set
Matrix3x2d set(Matrix3x2d m)

Set the elements of this matrix to the ones in <code>m</code>.

set
Matrix3x2d set(Matrix2d m)

Set the left 2x2 submatrix of this {@link Matrix3x2d} to the given {@link Matrix2d} and don't change the other elements.

set
Matrix3x2d set(double m00, double m01, double m10, double m11, double m20, double m21)

Set the values within this matrix to the supplied double values. The result looks like this: <p> m00, m10, m20<br> m01, m11, m21<br>

set
Matrix3x2d set(double[] m)

Set the values in this matrix based on the supplied double array. The result looks like this: <p> 0, 2, 4<br> 1, 3, 5<br>

setTranslation
Matrix3x2d setTranslation(double x, double y)

Set only the translation components of this matrix <code>(m20, m21)</code> to the given values <code>(x, y)</code>. <p> To build a translation matrix instead, use {@link #translation(double, double)}. To apply a translation to another matrix, use {@link #translate(double, double)}.

setTranslation
Matrix3x2d setTranslation(Vector2d offset)

Set only the translation components of this matrix <code>(m20, m21)</code> to the given values <code>(offset.x, offset.y)</code>. <p> To build a translation matrix instead, use {@link #translation(Vector2d)}. To apply a translation to another matrix, use {@link #translate(Vector2d)}.

setView
Matrix3x2d setView(double left, double right, double bottom, double top)

Set this matrix to define a "view" transformation that maps the given <code>(left, bottom)</code> and <code>(right, top)</code> corners to <code>(-1, -1)</code> and <code>(1, 1)</code> respectively.

span
Matrix3x2d span(Vector2d corner, Vector2d xDir, Vector2d yDir)

Compute the extents of the coordinate system before this transformation was applied and store the resulting corner coordinates in <code>corner</code> and the span vectors in <code>xDir</code> and <code>yDir</code>. <p> That means, given the maximum extents of the coordinate system between <code>[-1..+1]</code> 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 <code>[-1, +1]</code>.

testAar
bool testAar(double minX, double minY, double maxX, double maxY)
Undocumented in source. Be warned that the author may not have intended to support it.
testCircle
bool testCircle(double x, double y, double r)
Undocumented in source. Be warned that the author may not have intended to support it.
testPoint
bool testPoint(double x, double y)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector3d transform(Vector3d v)

Transform/multiply the given vector by this matrix by assuming a third row in this matrix of <code>(0, 0, 1)</code> and store the result in that vector.

transform
Vector3d transform(Vector3d v, Vector3d dest)

Transform/multiply the given vector by this matrix by assuming a third row in this matrix of <code>(0, 0, 1)</code> and store the result in <code>dest</code>.

transform
Vector3d transform(double x, double y, double z, Vector3d dest)

Transform/multiply the given vector <code>(x, y, z)</code> by this matrix and store the result in <code>dest</code>.

transformDirection
Vector2d transformDirection(Vector2d v)

Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result in that vector. <p> The given 2D-vector is treated as a 3D-vector with its z-component being <code>0.0</code>, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account. <p> In order to store the result in another vector, use {@link #transformDirection(Vector2d, Vector2d)}.

transformDirection
Vector2d transformDirection(Vector2d v, Vector2d dest)

Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result in <code>dest</code>. <p> The given 2D-vector is treated as a 3D-vector with its z-component being <code>0.0</code>, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account. <p> In order to store the result in the same vector, use {@link #transformDirection(Vector2d)}.

transformDirection
Vector2d transformDirection(double x, double y, Vector2d dest)

Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=0, by this matrix and store the result in <code>dest</code>. <p> The given 2D-vector is treated as a 3D-vector with its z-component being <code>0.0</code>, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account. <p> In order to store the result in the same vector, use {@link #transformDirection(Vector2d)}.

transformPosition
Vector2d transformPosition(Vector2d v)

Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result in that vector. <p> The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction. <p> In order to store the result in another vector, use {@link #transformPosition(Vector2d, Vector2d)}.

transformPosition
Vector2d transformPosition(Vector2d v, Vector2d dest)

Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result in <code>dest</code>. <p> The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction. <p> In order to store the result in the same vector, use {@link #transformPosition(Vector2d)}.

transformPosition
Vector2d transformPosition(double x, double y, Vector2d dest)

Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=1, by this matrix and store the result in <code>dest</code>. <p> The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction. <p> In order to store the result in the same vector, use {@link #transformPosition(Vector2d)}.

translate
Matrix3x2d 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 in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>M * T</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * T * v</code>, the translation will be applied first! <p> In order to set the matrix to a translation transformation without post-multiplying it, use {@link #translation(double, double)}.

translate
Matrix3x2d translate(double x, double y)

Apply a translation to this matrix by translating by the given number of units in x and y. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>M * T</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * T * v</code>, the translation will be applied first! <p> In order to set the matrix to a translation transformation without post-multiplying it, use {@link #translation(double, double)}.

translate
Matrix3x2d translate(Vector2d 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 in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>M * T</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * T * v</code>, the translation will be applied first! <p> In order to set the matrix to a translation transformation without post-multiplying it, use {@link #translation(Vector2d)}.

translate
Matrix3x2d translate(Vector2d offset)

Apply a translation to this matrix by translating by the given number of units in x and y. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>M * T</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * T * v</code>, the translation will be applied first! <p> In order to set the matrix to a translation transformation without post-multiplying it, use {@link #translation(Vector2d)}.

translateLocal
Matrix3x2d translateLocal(Vector2d offset)

Pre-multiply a translation to this matrix by translating by the given number of units in x and y. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>T * M * v</code>, the translation will be applied last! <p> In order to set the matrix to a translation transformation without pre-multiplying it, use {@link #translation(Vector2d)}.

translateLocal
Matrix3x2d translateLocal(Vector2d offset, Matrix3x2d dest)

Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>T * M * v</code>, the translation will be applied last! <p> In order to set the matrix to a translation transformation without pre-multiplying it, use {@link #translation(Vector2d)}.

translateLocal
Matrix3x2d translateLocal(double x, double y, Matrix3x2d dest)

Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>T * M * v</code>, the translation will be applied last! <p> In order to set the matrix to a translation transformation without pre-multiplying it, use {@link #translation(double, double)}.

translateLocal
Matrix3x2d translateLocal(double x, double y)

Pre-multiply a translation to this matrix by translating by the given number of units in x and y. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>T * M * v</code>, the translation will be applied last! <p> In order to set the matrix to a translation transformation without pre-multiplying it, use {@link #translation(double, double)}.

translation
Matrix3x2d translation(double x, double y)

Set this matrix to be a simple translation matrix in a two-dimensional coordinate system. <p> The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation. <p> In order to apply a translation via to an already existing transformation matrix, use {@link #translate(double, double) translate()} instead.

translation
Matrix3x2d translation(Vector2d offset)

Set this matrix to be a simple translation matrix in a two-dimensional coordinate system. <p> The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation. <p> In order to apply a translation via to an already existing transformation matrix, use {@link #translate(Vector2d) translate()} instead.

unproject
Vector2d unproject(double winX, double winY, int[] viewport, Vector2d dest)

Unproject the given window coordinates <code>(winX, winY)</code> by <code>this</code> matrix using the specified viewport. <p> This method first converts the given window coordinates to normalized device coordinates in the range <code>[-1..1]</code> and then transforms those NDC coordinates by the inverse of <code>this</code> matrix. <p> As a necessary computation step for unprojecting, this method computes the inverse of <code>this</code> matrix. In order to avoid computing the matrix inverse with every invocation, the inverse of <code>this</code> matrix can be built once outside using {@link #invert(Matrix3x2d)} and then the method {@link #unprojectInv(double, double, int[], Vector2d) unprojectInv()} can be invoked on it.

unprojectInv
Vector2d unprojectInv(double winX, double winY, int[] viewport, Vector2d dest)

Unproject the given window coordinates <code>(winX, winY)</code> by <code>this</code> matrix using the specified viewport. <p> This method differs from {@link #unproject(double, double, int[], Vector2d) unproject()} in that it assumes that <code>this</code> is already the inverse matrix of the original projection matrix. It exists to avoid recomputing the matrix inverse with every invocation.

view
Matrix3x2d view(double left, double right, double bottom, double top, Matrix3x2d dest)

Apply a "view" transformation to this matrix that maps the given <code>(left, bottom)</code> and <code>(right, top)</code> corners to <code>(-1, -1)</code> and <code>(1, 1)</code> respectively and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>O</code> the orthographic projection matrix, then the new matrix will be <code>M * O</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * O * v</code>, the orthographic projection transformation will be applied first!

view
Matrix3x2d view(double left, double right, double bottom, double top)

Apply a "view" transformation to this matrix that maps the given <code>(left, bottom)</code> and <code>(right, top)</code> corners to <code>(-1, -1)</code> and <code>(1, 1)</code> respectively. <p> If <code>M</code> is <code>this</code> matrix and <code>O</code> the orthographic projection matrix, then the new matrix will be <code>M * O</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * O * v</code>, the orthographic projection transformation will be applied first!

viewArea
double[] viewArea(double[] area)

Obtain the extents of the view transformation of <code>this</code> matrix and store it in <code>area</code>. This can be used to determine which region of the screen (i.e. the NDC space) is covered by the view.

zero
Matrix3x2d zero()

Set all values within this matrix to zero.

Variables

m00
double m00;
Undocumented in source.
m01
double m01;
Undocumented in source.
m10
double m10;
Undocumented in source.
m11
double m11;
Undocumented in source.
m20
double m20;
Undocumented in source.
m21
double m21;
Undocumented in source.

Meta