AffineTransformationMatrix2

data class AffineTransformationMatrix2(val m00: Double, val m01: Double, val m02: Double, val m10: Double, val m11: Double, val m12: Double) : Transformer<Vec2> (source)

Represents a 2D affine transformation matrix.

Constructors

Link copied to clipboard
constructor(m00: Double, m01: Double, m02: Double, m10: Double, m11: Double, m12: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val m00: Double

The element at row 0, column 0.

Link copied to clipboard
val m01: Double

The element at row 0, column 1.

Link copied to clipboard
val m02: Double

The element at row 0, column 2.

Link copied to clipboard
val m10: Double

The element at row 1, column 0.

Link copied to clipboard
val m11: Double

The element at row 1, column 1.

Link copied to clipboard
val m12: Double

The element at row 1, column 2.

Functions

Link copied to clipboard
open override fun apply(obj: Vec2): Vec2

Applies the transformation to a point.

Link copied to clipboard

Computes the determinant of the affine transformation matrix.

Link copied to clipboard
fun eq(other: AffineTransformationMatrix2, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): Boolean

Tests if two affine transformation matrices are approximately equal.

Link copied to clipboard

Get the inverse of this transformation.

Link copied to clipboard
open override fun preserveOrientation(): Boolean

Checks if the transformation preserves the orientation of points. For example: In 3D space, a translation preserves orientation, while a reflection does not.

Link copied to clipboard
fun rotate(angle: Double, angleUnit: AngleUnit = AngleUnit.RADIANS): AffineTransformationMatrix2

Rotates the transformation matrix by a specified angle. The angle can be specified in either radians or degrees.

Link copied to clipboard

Scales the transformation matrix by a given vector. The x and y components of the vector represent the scaling factors in the respective directions.

Scales the transformation matrix by a given factor in both x and y directions.

Scales the transformation matrix by given factors in the x and y directions.

Link copied to clipboard

Shears the transformation matrix by specified factors in the x and y directions.

Link copied to clipboard

Multiplies two affine transformation matrices.

Link copied to clipboard

Get the array representation of the transformation matrix.

Link copied to clipboard

Translates the transformation matrix by a given vector. The x and y components of the vector represent the translation in the respective directions.

Translates the transformation matrix by a given distance in the x and y directions.