이제 두 번째 Android 11 개발자 프리뷰를 사용할 수 있습니다. 테스트해 보고 의견을 공유하세요.

# androidx.ui.graphics.vectormath

## Classes

 Matrix3 Matrix4 Vector2 Vector3 Vector4

## Enums

 MatrixColumn VectorComponent

## Top-level constants summary

 const Float `FOUR_PI` const Float `HALF_PI` const Float `INV_FOUR_PI` const Float `INV_PI` const Float `INV_TWO_PI` const Float `PI` const Float `TWO_PI`

## Top-level functions summary

 Vector2 `abs(v: Vector2)` Vector3 `abs(v: Vector3)` Vector4 `abs(v: Vector4)` Vector3 `cross(a: Vector3, b: Vector3)` Float `degrees(v: Float)` Float `distance(a: Vector2, b: Vector2)` Float `distance(a: Vector3, b: Vector3)` Float `distance(a: Vector4, b: Vector4)` Float `dot(a: Vector2, b: Vector2)` Float `dot(a: Vector3, b: Vector3)` Float `dot(a: Vector4, b: Vector4)` Matrix3 `inverse(m: Matrix3)` Matrix4 `inverse(m: 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 `length(v: Vector2)` Float `length(v: Vector3)` Float `length(v: Vector4)` Float `length2(v: Vector2)` Float `length2(v: Vector3)` Float `length2(v: Vector4)` 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 `matrixEquals(a: Matrix4?, b: Matrix4?)` Returns true if the given matrices are exactly equal, and false otherwise. Float `max(v: Vector2)` Vector2 `max(a: Vector2, b: Vector2)` Float `max(v: Vector3)` Vector3 `max(a: Vector3, b: Vector3)` Float `max(v: Vector4)` Vector4 `max(a: Vector4, b: Vector4)` Float `min(v: Vector2)` Vector2 `min(a: Vector2, b: Vector2)` Float `min(v: Vector3)` Vector3 `min(a: Vector3, b: Vector3)` Float `min(v: Vector4)` Vector4 `min(a: Vector4, b: Vector4)` Matrix4 `normal(m: Matrix4)` Vector2 `normalize(v: Vector2)` Vector3 `normalize(v: Vector3)` Vector4 `normalize(v: 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 `radians(v: Float)` Vector2 `reflect(i: Vector2, n: Vector2)` Vector3 `reflect(i: Vector3, n: Vector3)` Vector2 `refract(i: Vector2, n: Vector2, eta: Float)` Vector3 `refract(i: Vector3, n: Vector3, eta: Float)` Matrix4 `rotation(m: Matrix4)` Matrix4 `rotation(d: Vector3)` Matrix4 `rotation(axis: Vector3, angle: Float)` Matrix4 `scale(s: Vector3)` Matrix4 `scale(m: Matrix4)` Vector2 `transform(v: Vector2, block: (Float) -> Float)` Vector3 `transform(v: Vector3, block: (Float) -> Float)` Vector4 `transform(v: Vector4, block: (Float) -> Float)` Matrix4 `translation(t: Vector3)` Matrix4 `translation(m: Matrix4)` Matrix3 `transpose(m: Matrix3)` Matrix4 `transpose(m: Matrix4)`

## Extension functions summary

 For kotlin.Float operator Vector2 `Float.div(v: Vector2)` operator Vector3 `Float.div(v: Vector3)` operator Vector4 `Float.div(v: Vector4)` operator Vector2 `Float.minus(v: Vector2)` operator Vector3 `Float.minus(v: Vector3)` operator Vector4 `Float.minus(v: Vector4)` operator Vector2 `Float.plus(v: Vector2)` operator Vector3 `Float.plus(v: Vector3)` operator Vector4 `Float.plus(v: Vector4)` operator Vector2 `Float.times(v: Vector2)` operator Vector3 `Float.times(v: Vector3)` operator Vector4 `Float.times(v: Vector4)`
 For Vector2 Vector2 `Vector2.coerceIn(min: Float, max: Float)` Vector2 `Vector2.coerceIn(min: Vector2, max: Vector2)`
 For Vector3 Vector3 `Vector3.coerceIn(min: Float, max: Float)` Vector3 `Vector3.coerceIn(min: Vector3, max: Vector3)` infix Vector3 `Vector3.x(v: Vector3)`
 For Vector4 Vector4 `Vector4.coerceIn(min: Float, max: Float)` Vector4 `Vector4.coerceIn(min: Vector4, max: Vector4)`
 For Matrix4 Float? `Matrix4.getAsScale()` Returns the given transform matrix as a Float describing a uniform scale, if the matrix is nothing but a symmetric 2D scale transform. Offset? `Matrix4.getAsTranslation()` Returns the given transform matrix as an Offset, if the matrix is nothing but a 2D translation. Boolean `Matrix4.isIdentity()` Whether the given matrix is the identity matrix. Offset `Matrix4.transformPoint(point: Offset)` Applies the given matrix as a perspective transform to the given point. Rect `Matrix4.transformRect(rect: 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`

### 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`

### 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`

`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`

### 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: 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`