# androidx.xr.runtime.math

*** ** * ** ***

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/BoundingBox` | Axis-aligned bounding box in 3D space, defined by minimum and maximum corners. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/FieldOfView` | Field of view of a virtual or rendering camera. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/FloatSize2d` | 2D size represented as a Float (e.g., panel dimensions in meters). |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/FloatSize3d` | 3D size represented as a Float (e.g., spatial volume dimensions in meters). |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/GeospatialPose` | Describes a specific location, elevation, and orientation relative to Earth. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/IntSize2d` | 2D size represented as an Int (e.g., panel dimensions in pixels). |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Matrix3` | An immutable 3x3 matrix that represents rotation and scale. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Matrix4` | An immutable 4x4 matrix that represents translation, scale, and rotation. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | Immutable rigid transformation from one coordinate space to another. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` | Represents a 4-point quadrilateral polygon in 2D space. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quaternion` | Rotation component in three-dimensional space. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray` | Ray in 3D space defined by an origin point and a direction vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | Position in the 2D plane. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | Three-dimensional position in space. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | Four-dimensional position in space. |

## Top-level functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#clamp(kotlin.Float,kotlin.Float,kotlin.Float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, min: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, max: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Clamps a value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#lerp(kotlin.Float,kotlin.Float,kotlin.Float)(a: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, b: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Linearly interpolates between two values. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toDegrees(kotlin.Float)(angleInRadians: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Converts `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toDegrees(kotlin.Float)` from radians to degrees. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toRadians(kotlin.Float)(angleInDegrees: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Converts `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toRadians(kotlin.Float)` from degrees to radians. |

## Top-level functions

### clamp

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/FloatExt.kt+function:clamp) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun clamp(x: Float, min: Float, max: Float): Float
```

Clamps a value.

| Parameters |
|---|---|
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the value to clamp |
| `min: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the minimum value |
| `max: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the maximum value |

### lerp

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/FloatExt.kt+function:lerp) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun lerp(a: Float, b: Float, t: Float): Float
```

Linearly interpolates between two values.

| Parameters |
|---|---|
| `a: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the start value |
| `b: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the end value |
| `t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the ratio between the two floats |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the interpolated value between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#lerp(kotlin.Float,kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#lerp(kotlin.Float,kotlin.Float,kotlin.Float)` |

### toDegrees

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/FloatExt.kt+function:toDegrees) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun toDegrees(angleInRadians: Float): Float
```

Converts `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toDegrees(kotlin.Float)` from radians to degrees.

| Parameters |
|---|---|
| `angleInRadians: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the angle in radians |

### toRadians

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/FloatExt.kt+function:toRadians) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

```
fun toRadians(angleInDegrees: Float): Float
```

Converts `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/package-summary#toRadians(kotlin.Float)` from degrees to radians.

| Parameters |
|---|---|
| `angleInDegrees: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the angle in degrees |