Matrix3

open class Matrix3

3 x 3 matrix in row-major order.

Constructors

Link copied to clipboard
constructor()

Constructs a 3 x 3 identity matrix.

constructor(m11: Double, m12: Double, m13: Double, m21: Double, m22: Double, m23: Double, m31: Double, m32: Double, m33: Double)

Constructs a 3 x 3 matrix with specified components.

constructor(matrix: Matrix3)

Constructs a 3 x 3 matrix with the components of a specified matrix.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The matrix's components, stored in row-major order.

Functions

Link copied to clipboard
fun copy(matrix: Matrix3): Matrix3

Sets this 3 x 3 matrix to the components of a specified matrix.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Inverts this matrix in place.
This throws an exception if this matrix is singular.

Link copied to clipboard

Inverts the specified matrix and stores the result in this matrix.
This throws an exception if the matrix is singular.
The result of this method is undefined if this matrix is passed in as the matrix to invert.

Link copied to clipboard

Multiplies this matrix by a specified matrix.

fun multiplyByMatrix(m11: Double, m12: Double, m13: Double, m21: Double, m22: Double, m23: Double, m31: Double, m32: Double, m33: Double): Matrix3

Multiplies this matrix by a matrix specified by individual components.

Link copied to clipboard

Multiplies this matrix by a rotation matrix about a specified axis and angle. Positive angles are interpreted as counter-clockwise rotation.

Link copied to clipboard
fun multiplyByScale(xScale: Double, yScale: Double): Matrix3

Multiplies this matrix by a scale matrix with specified values.

Link copied to clipboard

Multiplies this matrix by a matrix that transforms normalized coordinates from a source sector to a destination sector. Normalized coordinates within a sector range from 0 to 1, with (0, 0) indicating the lower left corner and (1, 1) indicating the upper right. The resultant matrix maps a normalized source coordinate (X, Y) to its corresponding normalized destination coordinate (X', Y').
This matrix typically necessary to transform texture coordinates from one geographic region to another. For example, the texture coordinates for a terrain tile spanning one region must be transformed to coordinates appropriate for an image tile spanning a potentially different region.

Link copied to clipboard

Multiplies this matrix by a translation matrix with specified translation values.

Link copied to clipboard

Multiplies this matrix by a matrix that flips and shifts the y-axis. The vertical flip matrix maps Y=0 to Y=1 and Y=1 to Y=0. This matrix is usually used to change the coordinate origin from an upper left coordinate origin to a lower left coordinate origin.
This is typically necessary to align the coordinate system of images (top-left origin) with that of OpenGL (bottom-left origin).

Link copied to clipboard
fun set(m11: Double, m12: Double, m13: Double, m21: Double, m22: Double, m23: Double, m31: Double, m32: Double, m33: Double): Matrix3

Sets this 3 x 3 matrix to specified components.

Link copied to clipboard

Sets the rotation components of this matrix to a specified angle. Positive angles are interpreted as counter-clockwise rotation.

Link copied to clipboard
fun setScale(xScale: Double, yScale: Double): Matrix3

Sets the scale components of this matrix to specified values.

Link copied to clipboard

Sets this matrix to the 3 x 3 identity matrix.

Link copied to clipboard

Sets this matrix to the matrix product of two specified matrices.

Link copied to clipboard

Set this matrix to the ground-to-image homography that maps four arbitrary corners ((0,0), (p1x,p1y), (p2x,p2y), (p3x,p3y), in counter-clockwise order: bottom-left, bottom-right, top-right, top-left) to the unit square (0,0), (1,0), (1,1), (0,1).

Link copied to clipboard

Sets this matrix to a rotation matrix with a specified angle. Positive angles are interpreted as counter-clockwise rotation.

Link copied to clipboard
fun setToScale(xScale: Double, yScale: Double): Matrix3

Sets this matrix to a scale matrix with specified scale components.

Link copied to clipboard

Sets this matrix to one that transforms normalized coordinates from a source sector to a destination sector. Normalized coordinates within a sector range from 0 to 1, with (0, 0) indicating the lower left corner and (1, 1) indicating the upper right. The resultant matrix maps a normalized source coordinate (X, Y) to its corresponding normalized destination coordinate (X', Y').
This matrix typically necessary to transform texture coordinates from one geographic region to another. For example, the texture coordinates for a terrain tile spanning one region must be transformed to coordinates appropriate for an image tile spanning a potentially different region.

Link copied to clipboard

Sets this matrix to a translation matrix with specified translation components.

Link copied to clipboard

Sets this matrix to one that flips and shifts the y-axis. The resultant matrix maps Y=0 to Y=1 and Y=1 to Y=0. All existing values are overwritten. This matrix is usually used to change the coordinate origin from an upper left coordinate origin to a lower left coordinate origin.
This matrix is typically necessary to align the coordinate system of images (top-left origin) with that of OpenGL (bottom-left origin).

Link copied to clipboard

Sets the translation components of this matrix to specified values.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Transposes this matrix in place.

Link copied to clipboard

Transposes the specified matrix and stores the result in this matrix.

Link copied to clipboard
fun transposeToArray(result: FloatArray, offset: Int): FloatArray

Transposes this matrix, storing the result in the specified single precision array. The result is compatible with GLSL uniform matrices, and can be passed to the function glUniformMatrix3fv.