Create a new {@link Matrix3x2d} by setting its left 2x2 submatrix to the values of the given {@link Matrix2d} and the rest to identity.
Create a new {@link Matrix3x2d} and make it a copy of the given matrix.
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.
Set the value of the matrix element at column 0 and row 0.
Set the value of the matrix element at column 0 and row 1.
Set the value of the matrix element at column 1 and row 0.
Set the value of the matrix element at column 1 and row 1.
Set the value of the matrix element at column 2 and row 0.
Set the value of the matrix element at column 2 and row 1.
Return the determinant of this matrix.
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.
Store this matrix into the supplied double array in column-major order at the given offset.
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)}.
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied double array at the given offset.
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied double array. <p> In order to specify an explicit offset into the array, use the method {@link #get3x3(double[], int)}.
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied double array at the given offset.
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied double array. <p> In order to specify an explicit offset into the array, use the method {@link #get4x4(double[], int)}.
Set this matrix to the identity.
Invert this matrix by assuming a third row in this matrix of <code>(0, 0, 1)</code>.
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>.
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!
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!
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!
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>
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!
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!
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!
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!
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>
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>
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!
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!
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.
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!
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!
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!
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!
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!
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!
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>
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>
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>
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>
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>
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>
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!
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!
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.
Set this matrix to be a simple scale matrix.
Set the elements of this matrix to the ones in <code>m</code>.
Set the left 2x2 submatrix of this {@link Matrix3x2d} to the given {@link Matrix2d} and don't change the other elements.
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 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>
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)}.
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)}.
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.
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>.
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/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/multiply the given vector <code>(x, y, z)</code> by this matrix and store the result in <code>dest</code>.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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)}.
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.
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 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.
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.
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!
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!
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.
Set all values within this matrix to zero.
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