# Pose

Artifact: [androidx.xr.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/xr-runtime) [View Source](https://cs.android.com/search?q=file:androidx/xr/runtime/math/Pose.kt+class:androidx.xr.runtime.math.Pose) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

*** ** * ** ***


```
class Pose
```

<br />

*** ** * ** ***

Immutable rigid transformation from one coordinate space to another.

## Summary

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#distance(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose)(lhs: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, rhs: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Returns the distance between the two poses. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(eye: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, target: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, up: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Creates a pose looking at `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` from `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, end: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, ratio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Linearly interpolates between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)` by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)`. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#Identity()` Returns a new pose using the identity rotation. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#Pose(androidx.xr.runtime.math.Pose)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Creates a new pose with the same values as the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#(androidx.xr.runtime.math.Pose)` pose. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#Pose(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Quaternion)(translation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, rotation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion)` |

| ### Public functions |
|---|---|
| `infix https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#compose(androidx.xr.runtime.math.Pose)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Returns the result of composing `this` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#compose(androidx.xr.runtime.math.Pose)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#copy(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Quaternion)(translation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, rotation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion)` Returns a copy of the pose. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Returns true if this pose is equal to the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#equals(kotlin.Any)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getForwardVectorToUpRotation(androidx.xr.runtime.math.Pose)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Calculates rotation to align local Z-axis `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#forward()` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getForwardVectorToUpRotation(androidx.xr.runtime.math.Pose)`'s `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#up()` direction. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getUpVectorToUpRotation(androidx.xr.runtime.math.Pose)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Calculates rotation to align local Y-axis `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#up()` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getUpVectorToUpRotation(androidx.xr.runtime.math.Pose)`'s up direction. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#hashCode()()` |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#rotate(androidx.xr.runtime.math.Quaternion)(rotation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion)` Rotates this pose by the given `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#rotate(androidx.xr.runtime.math.Quaternion)`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#toString()()` |
| `infix https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformPoint(androidx.xr.runtime.math.Vector3)(point: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Transforms `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformPoint(androidx.xr.runtime.math.Vector3)` using pose rotation and translation. |
| `infix https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformVector(androidx.xr.runtime.math.Vector3)(vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Transforms `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformVector(androidx.xr.runtime.math.Vector3)` using only pose rotation. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#translate(androidx.xr.runtime.math.Vector3)(translation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Translates this pose by the given `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#translate(androidx.xr.runtime.math.Vector3)`. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#backward()` The backward vector in the local coordinate system. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#down()` The down vector in the local coordinate system. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#forward()` The forward vector in the local coordinate system. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#inverse()` Returns a pose that performs the opposite transformation. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#left()` The left vector in the local coordinate system. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#right()` The right vector in the local coordinate system. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#rotation()` the rotation component of this pose |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#translation()` the translation component of this pose |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#up()` The up vector in the local coordinate system. |

## Public companion functions

### distance

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun distance(lhs: Pose, rhs: Pose): Float
```

Returns the distance between the two poses.

| Parameters |
|---|---|
| `lhs: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the first pose |
| `rhs: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the second pose |

### fromLookAt

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun fromLookAt(eye: Vector3, target: Vector3, up: Vector3 = Vector3.Up): Pose
```

Creates a pose looking at `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` from `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` vector.

| Parameters |
|---|---|
| `eye: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the position from which to look at `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` |
| `target: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the target position to look at |
| `up: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3 = Vector3.Up` | a vector indicating the general "up" direction |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the pose oriented to look at `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` from `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` position with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#fromLookAt(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` as the up vector |

### lerp

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun lerp(start: Pose, end: Pose, ratio: Float): Pose
```

Linearly interpolates between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)` by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)`. The position is `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)`, but the rotation will be `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion#slerp(androidx.xr.runtime.math.Quaternion,androidx.xr.runtime.math.Quaternion,kotlin.Float)` if the angles are far apart.

If `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose.Companion#lerp(androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Pose,kotlin.Float)` is outside of the range `[0, 1]`, the returned pose will be extrapolated.

| Parameters |
|---|---|
| `start: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the starting pose |
| `end: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the ending pose |
| `ratio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the interpolation ratio |

## Public companion properties

### Identity

```
val Identity: Pose
```

Returns a new pose using the identity rotation.

## Public constructors

### Pose

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
Pose(other: Pose)
```

Creates a new pose with the same values as the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#(androidx.xr.runtime.math.Pose)` pose.

### Pose

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
Pose(translation: Vector3 = Vector3(), rotation: Quaternion = Quaternion())
```

## Public functions

### compose

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
infix fun compose(other: Pose): Pose
```

Returns the result of composing `this` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#compose(androidx.xr.runtime.math.Pose)`.

### copy

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun copy(
    translation: Vector3 = this.translation,
    rotation: Quaternion = this.rotation
): Pose
```

Returns a copy of the pose.

| Parameters |
|---|---|
| `translation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3 = this.translation` | the new translation for the copied pose |
| `rotation: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion = this.rotation` | the new rotation for the copied pose |

### equals

```
open operator fun equals(other: Any?): Boolean
```

Returns true if this pose is equal to the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#equals(kotlin.Any)`.

### getForwardVectorToUpRotation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun getForwardVectorToUpRotation(other: Pose): Quaternion
```

Calculates rotation to align local Z-axis `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#forward()` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getForwardVectorToUpRotation(androidx.xr.runtime.math.Pose)`'s `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#up()` direction.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the given pose |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | a Quaternion representing the rotation to apply to the pose |

### getUpVectorToUpRotation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun getUpVectorToUpRotation(other: Pose): Quaternion
```

Calculates rotation to align local Y-axis `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#up()` with `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#getUpVectorToUpRotation(androidx.xr.runtime.math.Pose)`'s up direction.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | the given pose |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | a Quaternion representing the rotation to apply to the pose |

### hashCode

```
open fun hashCode(): Int
```

### rotate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun rotate(rotation: Quaternion): Pose
```

Rotates this pose by the given `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#rotate(androidx.xr.runtime.math.Quaternion)`.

### toString

```
open fun toString(): String
```

### transformPoint

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
infix fun transformPoint(point: Vector3): Vector3
```

Transforms `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformPoint(androidx.xr.runtime.math.Vector3)` using pose rotation and translation. A point represents a specific location in space and is affected by translation, scale, and orientation.

### transformVector

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
infix fun transformVector(vector: Vector3): Vector3
```

Transforms `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#transformVector(androidx.xr.runtime.math.Vector3)` using only pose rotation. A vector represents a direction and magnitude, not a specific location. It only needs to account for the scale and orientation of the space it is in since it has no position.

### translate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun translate(translation: Vector3): Pose
```

Translates this pose by the given `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose#translate(androidx.xr.runtime.math.Vector3)`.

## Public properties

### backward

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val backward: Vector3
```

The backward vector in the local coordinate system.

### down

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val down: Vector3
```

The down vector in the local coordinate system.

### forward

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val forward: Vector3
```

The forward vector in the local coordinate system.

### inverse

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val inverse: Pose
```

Returns a pose that performs the opposite transformation.

### left

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val left: Vector3
```

The left vector in the local coordinate system.

### right

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val right: Vector3
```

The right vector in the local coordinate system.

### rotation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val rotation: Quaternion
```

the rotation component of this pose

### translation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val translation: Vector3
```

the translation component of this pose

### up

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
val up: Vector3
```

The up vector in the local coordinate system.