openrndr / org.openrndr.math / Matrix44

Matrix44

data class Matrix44 : Serializable (source)

A 4x4 matrix with double precision

Constructors

<init>

A 4x4 matrix with double precision

Matrix44(c0r0: Double = 0.0, c1r0: Double = 0.0, c2r0: Double = 0.0, c3r0: Double = 0.0, c0r1: Double = 0.0, c1r1: Double = 0.0, c2r1: Double = 0.0, c3r1: Double = 0.0, c0r2: Double = 0.0, c1r2: Double = 0.0, c2r2: Double = 0.0, c3r2: Double = 0.0, c0r3: Double = 0.0, c1r3: Double = 0.0, c2r3: Double = 0.0, c3r3: Double = 0.0)

Properties

c0r0

val c0r0: Double

c0r1

val c0r1: Double

c0r2

val c0r2: Double

c0r3

val c0r3: Double

c1r0

val c1r0: Double

c1r1

val c1r1: Double

c1r2

val c1r2: Double

c1r3

val c1r3: Double

c2r0

val c2r0: Double

c2r1

val c2r1: Double

c2r2

val c2r2: Double

c2r3

val c2r3: Double

c3r0

val c3r0: Double

c3r1

val c3r1: Double

c3r2

val c3r2: Double

c3r3

val c3r3: Double

determinant

val determinant: Double

inversed

Inversed version of the 4x4 matrix

val inversed: Matrix44

matrix33

The 3x3 top-left part of the 4x4 matrix

val matrix33: Matrix33

trace

The trace of the 4x4 matrix

val trace: Double

transposed

Returns a transposed version of the matrix

val transposed: Matrix44

Functions

get

Returns a column vector

operator fun get(index: Int): Vector4

minus

Matrix subtraction

operator fun minus(o: Matrix44): Matrix44

plus

Matrix addition

operator fun plus(o: Matrix44): Matrix44

times

Multiplies the 4x4 matrix with a vector 4

operator fun times(v: Vector4): Vector4

Multiplies all the elements in the 4x4 matrix with a scalar

operator fun times(s: Double): Matrix44

Matrix concatenation

operator fun times(mat: Matrix44): Matrix44

toString

fun toString(): String

Companion Object Properties

IDENTITY

4x4 identity matrix

val IDENTITY: Matrix44

ZERO

4x4 zero matrix

val ZERO: Matrix44

Companion Object Functions

fromColumnVectors

Create a 4x4 matrix from column vectors

fun fromColumnVectors(c0: Vector4, c1: Vector4, c2: Vector4, c3: Vector4): Matrix44

fromDoubleArray

fun fromDoubleArray(a: DoubleArray): Matrix44

Companion Object Extension Functions

rotate

Create a rotation matrix around the given axes

fun Matrix44.Companion.rotate(axis: Vector3, angle: Double): Matrix44

rotateX

Create a rotation matrix around the X axes

fun Matrix44.Companion.rotateX(angle: Double): Matrix44

rotateY

Create a rotation matrix around the Y axes

fun Matrix44.Companion.rotateY(angle: Double): Matrix44

rotateZ

Create a rotation matrix around the Z axes

fun Matrix44.Companion.rotateZ(angle: Double): Matrix44

scale

Create a scaling matrix with the given vector

fun Matrix44.Companion.scale(scaleFactor: Vector3): Matrix44

Create a scaling matrix with the given components

fun Matrix44.Companion.scale(x: Double, y: Double, z: Double): Matrix44

translate

Create a translate matrix with the given vector

fun Matrix44.Companion.translate(translation: Vector3): Matrix44

Create a scaling matrix with the given components

fun Matrix44.Companion.translate(x: Double, y: Double, z: Double): Matrix44