androidx.ui.vectormath64

Classes

Matrix2

Matrix3

Matrix4

Vector2

Vector3

Vector4

Enums

MatrixColumn

VectorComponent

Top-level constants summary

const Float

const Float

const Float

const Float

const Float

const Float

const Float

Top-level functions summary

Vector2

Vector3

Vector4

Vector3

Float

Float

Float

Float

Float
dot(a: Vector2, b: Vector2)

Float
dot(a: Vector3, b: Vector3)

Float
dot(a: Vector4, b: Vector4)

Float

Matrix3

Matrix4

Rect
inverseTransformRect(transform: Matrix4, rect: Rect)

Returns a rect that bounds the result of applying the inverse of the given matrix as a perspective transform to the given rect.

Float

Float

Float

Float

Float

Float

Matrix4
lookAt(eye: Vector3, target: Vector3, up: Vector3 = Vector3(z = 1.0f))

Matrix4
lookTowards(eye: Vector3, forward: Vector3, up: Vector3 = Vector3(z = 1.0f))

Boolean

Returns true if the given matrices are exactly equal, and false otherwise.

Float

Vector2
max(a: Vector2, b: Vector2)

Float

Vector3
max(a: Vector3, b: Vector3)

Float

Vector4
max(a: Vector4, b: Vector4)

Float

Vector2
min(a: Vector2, b: Vector2)

Float

Vector3
min(a: Vector3, b: Vector3)

Float

Vector4
min(a: Vector4, b: Vector4)

Float
mix(a: Float, b: Float, x: Float)

Vector2
mix(a: Vector2, b: Vector2, x: Float)

Vector2
mix(a: Vector2, b: Vector2, x: Vector2)

Vector3
mix(a: Vector3, b: Vector3, x: Float)

Vector3
mix(a: Vector3, b: Vector3, x: Vector3)

Vector4
mix(a: Vector4, b: Vector4, x: Float)

Vector4
mix(a: Vector4, b: Vector4, x: Vector4)

Matrix4

Vector2

Vector3

Vector4

Matrix4
ortho(l: Float, r: Float, b: Float, t: Float, n: Float, f: Float)

Matrix4
perspective(fov: Float, ratio: Float, near: Float, far: Float)

Float

Vector2

Vector3

Vector2
refract(i: Vector2, n: Vector2, eta: Float)

Vector3
refract(i: Vector3, n: Vector3, eta: Float)

Matrix4

Matrix4

Matrix4
rotation(axis: Vector3, angle: Float)

Matrix4

Matrix4

Float
sqr(v: Float)

Vector2
transform(v: Vector2, block: (Float) -> Float)

Vector3
transform(v: Vector3, block: (Float) -> Float)

Vector4
transform(v: Vector4, block: (Float) -> Float)

Matrix4

Matrix4

Matrix2

Matrix3

Matrix4

Extension functions summary

For kotlin.Float
operator Vector2

operator Vector3

operator Vector4

operator Vector2

operator Vector3

operator Vector4

operator Vector2

operator Vector3

operator Vector4

operator Vector2

operator Vector3

operator Vector4

For Vector2
Vector2
Vector2.coerceIn(min: Float, max: Float)

Vector2

For Vector3
Vector3
Vector3.coerceIn(min: Float, max: Float)

Vector3

infix Vector3

For Vector4
Vector4
Vector4.coerceIn(min: Float, max: Float)

Vector4

For Matrix4
Float?

Returns the given transform matrix as a Float describing a uniform scale, if the matrix is nothing but a symmetric 2D scale transform.

Offset?

Returns the given transform matrix as an Offset, if the matrix is nothing but a 2D translation.

Boolean

Whether the given matrix is the identity matrix.

Offset

Applies the given matrix as a perspective transform to the given point.

Rect

Returns a rect that bounds the result of applying the given matrix as a perspective transform to the given rect.

Top-level constants

FOUR_PI

const val FOUR_PI: Float
Value: PI * 4.0f

HALF_PI

const val HALF_PI: Float
Value: PI * 0.5f

INV_FOUR_PI

const val INV_FOUR_PI: Float
Value: INV_PI * 0.25f

INV_PI

const val INV_PI: Float
Value: 1.0f / PI

INV_TWO_PI

const val INV_TWO_PI: Float
Value: INV_PI * 0.5f

PI

const val PI: Float
Value: 3.1415926536f

TWO_PI

const val TWO_PI: Float
Value: PI * 2.0f

Top-level functions

abs

inline fun abs(v: Vector2): Vector2

abs

inline fun abs(v: Vector3): Vector3

abs

inline fun abs(v: Vector4): Vector4

cross

inline fun cross(
    a: Vector3,
    b: Vector3
): Vector3

degrees

inline fun degrees(v: Float): Float

distance

inline fun distance(
    a: Vector2,
    b: Vector2
): Float

distance

inline fun distance(
    a: Vector3,
    b: Vector3
): Float

distance

inline fun distance(
    a: Vector4,
    b: Vector4
): Float

dot

inline fun dot(
    a: Vector2,
    b: Vector2
): Float

dot

inline fun dot(
    a: Vector3,
    b: Vector3
): Float

dot

inline fun dot(
    a: Vector4,
    b: Vector4
): Float

fract

inline fun fract(v: Float): Float

inverse

fun inverse(m: Matrix3): Matrix3

inverse

fun inverse(m: Matrix4): Matrix4

inverseTransformRect

fun inverseTransformRect(
    transform: Matrix4,
    rect: Rect
): Rect

Returns a rect that bounds the result of applying the inverse of the given matrix as a perspective transform to the given rect.

This function assumes the given rect is in the plane with z equals 0.0. The transformed rect is then projected back into the plane with z equals 0.0 before computing its bounding rect.

length

inline fun length(v: Vector2): Float

length

inline fun length(v: Vector3): Float

length

inline fun length(v: Vector4): Float

length2

inline fun length2(v: Vector2): Float

length2

inline fun length2(v: Vector3): Float

length2

inline fun length2(v: Vector4): Float

lookAt

fun lookAt(
    eye: Vector3,
    target: Vector3,
    up: Vector3 = Vector3(z = 1.0f)
): Matrix4

lookTowards

fun lookTowards(
    eye: Vector3,
    forward: Vector3,
    up: Vector3 = Vector3(z = 1.0f)
): Matrix4

matrixEquals

fun matrixEquals(
    a: Matrix4?,
    b: Matrix4?
): Boolean

Returns true if the given matrices are exactly equal, and false otherwise. Null values are assumed to be the identity matrix.

max

inline fun max(v: Vector2): Float

max

inline fun max(
    a: Vector2,
    b: Vector2
): Vector2

max

inline fun max(v: Vector3): Float

max

inline fun max(
    a: Vector3,
    b: Vector3
): Vector3

max

inline fun max(v: Vector4): Float

max

inline fun max(
    a: Vector4,
    b: Vector4
): Vector4

min

inline fun min(v: Vector2): Float

min

inline fun min(
    a: Vector2,
    b: Vector2
): Vector2

min

inline fun min(v: Vector3): Float

min

inline fun min(
    a: Vector3,
    b: Vector3
): Vector3

min

inline fun min(v: Vector4): Float

min

inline fun min(
    a: Vector4,
    b: Vector4
): Vector4

mix

inline fun mix(
    a: Float,
    b: Float,
    x: Float
): Float

mix

inline fun mix(
    a: Vector2,
    b: Vector2,
    x: Float
): Vector2

mix

inline fun mix(
    a: Vector2,
    b: Vector2,
    x: Vector2
): Vector2

mix

inline fun mix(
    a: Vector3,
    b: Vector3,
    x: Float
): Vector3

mix

inline fun mix(
    a: Vector3,
    b: Vector3,
    x: Vector3
): Vector3

mix

inline fun mix(
    a: Vector4,
    b: Vector4,
    x: Float
): Vector4

mix

inline fun mix(
    a: Vector4,
    b: Vector4,
    x: Vector4
): Vector4

normal

fun normal(m: Matrix4): Matrix4

normalize

fun normalize(v: Vector2): Vector2

normalize

fun normalize(v: Vector3): Vector3

normalize

fun normalize(v: Vector4): Vector4

ortho

fun ortho(
    l: Float,
    r: Float,
    b: Float,
    t: Float,
    n: Float,
    f: Float
): Matrix4

perspective

fun perspective(
    fov: Float,
    ratio: Float,
    near: Float,
    far: Float
): Matrix4

radians

inline fun radians(v: Float): Float

reflect

inline fun reflect(
    i: Vector2,
    n: Vector2
): Vector2

reflect

inline fun reflect(
    i: Vector3,
    n: Vector3
): Vector3

refract

fun refract(
    i: Vector2,
    n: Vector2,
    eta: Float
): Vector2

refract

fun refract(
    i: Vector3,
    n: Vector3,
    eta: Float
): Vector3

rotation

fun rotation(m: Matrix4): Matrix4

rotation

fun rotation(d: Vector3): Matrix4

rotation

fun rotation(
    axis: Vector3,
    angle: Float
): Matrix4

scale

fun scale(s: Vector3): Matrix4

scale

fun scale(m: Matrix4): Matrix4

sqr

inline fun sqr(v: Float): Float

transform

inline fun transform(
    v: Vector2,
    block: (Float) -> Float
): Vector2

transform

inline fun transform(
    v: Vector3,
    block: (Float) -> Float
): Vector3

transform

inline fun transform(
    v: Vector4,
    block: (Float) -> Float
): Vector4

translation

fun translation(t: Vector3): Matrix4

translation

fun translation(m: Matrix4): Matrix4

transpose

fun transpose(m: Matrix2): Matrix2

transpose

fun transpose(m: Matrix3): Matrix3

transpose

fun transpose(m: Matrix4): Matrix4

Extension functions

coerceIn

inline fun Vector2.coerceIn(
    min: Float,
    max: Float
): Vector2

coerceIn

inline fun Vector2.coerceIn(
    min: Vector2,
    max: Vector2
): Vector2

coerceIn

inline fun Vector3.coerceIn(
    min: Float,
    max: Float
): Vector3

coerceIn

inline fun Vector3.coerceIn(
    min: Vector3,
    max: Vector3
): Vector3

coerceIn

inline fun Vector4.coerceIn(
    min: Float,
    max: Float
): Vector4

coerceIn

inline fun Vector4.coerceIn(
    min: Vector4,
    max: Vector4
): Vector4

div

inline operator fun Float.div(v: Vector2): Vector2

div

inline operator fun Float.div(v: Vector3): Vector3

div

inline operator fun Float.div(v: Vector4): Vector4

getAsScale

fun Matrix4.getAsScale(): Float?

Returns the given transform matrix as a Float describing a uniform scale, if the matrix is nothing but a symmetric 2D scale transform.

Otherwise, returns null.

getAsTranslation

fun Matrix4.getAsTranslation(): Offset?

Returns the given transform matrix as an Offset, if the matrix is nothing but a 2D translation.

Otherwise, returns null.

isIdentity

fun Matrix4.isIdentity(): Boolean

Whether the given matrix is the identity matrix.

minus

inline operator fun Float.minus(v: Vector2): Vector2

minus

inline operator fun Float.minus(v: Vector3): Vector3

minus

inline operator fun Float.minus(v: Vector4): Vector4

plus

inline operator fun Float.plus(v: Vector2): Vector2

plus

inline operator fun Float.plus(v: Vector3): Vector3

plus

inline operator fun Float.plus(v: Vector4): Vector4

times

inline operator fun Float.times(v: Vector2): Vector2

times

inline operator fun Float.times(v: Vector3): Vector3

times

inline operator fun Float.times(v: Vector4): Vector4

transformPoint

fun Matrix4.transformPoint(point: Offset): Offset

Applies the given matrix as a perspective transform to the given point.

this function assumes the given point has a z-coordinate of 0.0. the z-coordinate of the result is ignored.

transformRect

fun Matrix4.transformRect(rect: Rect): Rect

Returns a rect that bounds the result of applying the given matrix as a perspective transform to the given rect.

This function assumes the given rect is in the plane with z equals 0.0. The transformed rect is then projected back into the plane with z equals 0.0 before computing its bounding rect.

x

inline infix fun Vector3.x(v: Vector3): Vector3