# Vector3

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

*** ** * ** ***


```
class Vector3
```

<br />

*** ** * ** ***

Three-dimensional position in space.

The coordinate system is right-handed. The `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#x()`-axis points to the right, the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#y()`-axis up and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#z()`-axis back.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#abs(androidx.xr.runtime.math.Vector3)(vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the absolute values of each component of the vector. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#angleBetween(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the angle between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#angleBetween(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#angleBetween(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` in degrees. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#distance(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the distance between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#distance(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#distance(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#fromValue(kotlin.Float)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Creates a new vector with all components set to `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#fromValue(kotlin.Float)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, end: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, ratio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a new vector linearly interpolated between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)` by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#max(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the maximum of each component of the two vectors. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#min(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the minimum of each component of the two vectors. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#projectOnPlane(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, planeNormal: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Computes the vector projected from `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#projectOnPlane(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` onto `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#projectOnPlane(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)`. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Backward()` Vector with z set to one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Down()` Vector with y set to negative one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Forward()` Vector with z set to negative one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Left()` Vector with x set to negative one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#One()` Vector with all components set to one. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Right()` Vector with x set to one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Up()` Vector with y set to one and all other components set to zero. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Zero()` Vector with all components set to zero. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Vector3(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Creates a new vector with the same values as the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#(androidx.xr.runtime.math.Vector3)` vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Vector3(kotlin.Float,kotlin.Float,kotlin.Float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, z: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#clamp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns a new vector with its values clamped between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#clamp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#clamp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` vectors. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#copy(kotlin.Float,kotlin.Float,kotlin.Float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, z: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a copy of the vector. |
| `infix https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#cross(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the cross product of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#cross(androidx.xr.runtime.math.Vector3)` vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#div(kotlin.Float)(c: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a new vector with this vector divided by a scalar amount. |
| `infix https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#dot(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns the dot product of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#dot(androidx.xr.runtime.math.Vector3)` vector. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Returns true if this vector is equal to `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#equals(kotlin.Any)`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#hashCode()()` |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#inverse()()` Returns the component-wise multiplicative inverse of this vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#minus(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns a new vector with the difference of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#minus(androidx.xr.runtime.math.Vector3)` vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#plus(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns a new vector with the sum of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#plus(androidx.xr.runtime.math.Vector3)` vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#scale(androidx.xr.runtime.math.Vector3)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Returns a new vector by component-wise multiplying this vector by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#scale(androidx.xr.runtime.math.Vector3)`. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#times(kotlin.Float)(c: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Get a new vector multiplied by a scalar amount. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#toNormalized()()` Returns the normalized version of this vector. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#toString()()` |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#unaryMinus()()` Negates this vector. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#length()` The length of the vector. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#lengthSquared()` The squared length of the vector. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#x()` the value of the horizontal component |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#y()` the value of the vertical component |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#z()` the value of the forward component |

## Public companion functions

### abs

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

```
fun abs(vector: Vector3): Vector3
```

Returns the absolute values of each component of the vector.

| Parameters |
|---|---|
| `vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the vector to get the absolute values of |

### angleBetween

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

```
fun angleBetween(vector1: Vector3, vector2: Vector3): Float
```

Returns the angle between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#angleBetween(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#angleBetween(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` in degrees. The result is never greater than 180 degrees.

| Parameters |
|---|---|
| `vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the first vector |
| `vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the second vector |

### distance

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

```
fun distance(vector1: Vector3, vector2: Vector3): Float
```

Returns the distance between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#distance(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#distance(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)`.

| Parameters |
|---|---|
| `vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the first vector |
| `vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the second vector |

### fromValue

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

```
fun fromValue(value: Float): Vector3
```

Creates a new vector with all components set to `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#fromValue(kotlin.Float)`.

### lerp

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

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

Returns a new vector linearly interpolated between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)` by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#lerp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Float)`.

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

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

### max

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

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

Returns the maximum of each component of the two vectors.

| Parameters |
|---|---|
| `a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the first vector |
| `b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the second vector |

### min

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

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

Returns the minimum of each component of the two vectors.

| Parameters |
|---|---|
| `a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the first vector |
| `b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the second vector |

### projectOnPlane

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

```
fun projectOnPlane(vector: Vector3, planeNormal: Vector3): Vector3
```

Computes the vector projected from `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#projectOnPlane(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` onto `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3.Companion#projectOnPlane(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)`.

| Parameters |
|---|---|
| `vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the vector to project |
| `planeNormal: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the normal of the plane to project onto |

## Public companion properties

### Backward

```
val Backward: Vector3
```

Vector with z set to one and all other components set to zero.

### Down

```
val Down: Vector3
```

Vector with y set to negative one and all other components set to zero.

### Forward

```
val Forward: Vector3
```

Vector with z set to negative one and all other components set to zero.

### Left

```
val Left: Vector3
```

Vector with x set to negative one and all other components set to zero.

### One

```
val One: Vector3
```

Vector with all components set to one.

### Right

```
val Right: Vector3
```

Vector with x set to one and all other components set to zero.

### Up

```
val Up: Vector3
```

Vector with y set to one and all other components set to zero.

### Zero

```
val Zero: Vector3
```

Vector with all components set to zero.

## Public constructors

### Vector3

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

```
Vector3(other: Vector3)
```

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

### Vector3

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

```
Vector3(x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f)
```

## Public functions

### clamp

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

```
fun clamp(min: Vector3, max: Vector3): Vector3
```

Returns a new vector with its values clamped between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#clamp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#clamp(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)` vectors.

| Parameters |
|---|---|
| `min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the minimum clamp values |
| `max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | the maximum clamp values |

### copy

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

```
fun copy(x: Float = this.x, y: Float = this.y, z: Float = this.z): Vector3
```

Returns a copy of the vector.

| Parameters |
|---|---|
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = this.x` | the new x value for the copied vector |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = this.y` | the new y value for the copied vector |
| `z: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = this.z` | the new z value for the copied vector |

### cross

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

```
infix fun cross(other: Vector3): Vector3
```

Returns the cross product of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#cross(androidx.xr.runtime.math.Vector3)` vector.

### div

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

```
operator fun div(c: Float): Vector3
```

Returns a new vector with this vector divided by a scalar amount.

| Parameters |
|---|---|
| `c: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the scalar to divide by |

### dot

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

```
infix fun dot(other: Vector3): Float
```

Returns the dot product of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#dot(androidx.xr.runtime.math.Vector3)` vector.

### equals

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

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

### hashCode

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

### inverse

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

```
fun inverse(): Vector3
```

Returns the component-wise multiplicative inverse of this vector.

### minus

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

```
operator fun minus(other: Vector3): Vector3
```

Returns a new vector with the difference of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#minus(androidx.xr.runtime.math.Vector3)` vector.

### plus

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

```
operator fun plus(other: Vector3): Vector3
```

Returns a new vector with the sum of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#plus(androidx.xr.runtime.math.Vector3)` vector.

### scale

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

```
fun scale(other: Vector3): Vector3
```

Returns a new vector by component-wise multiplying this vector by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#scale(androidx.xr.runtime.math.Vector3)`.

### times

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

```
operator fun times(c: Float): Vector3
```

Get a new vector multiplied by a scalar amount.

| Parameters |
|---|---|
| `c: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the scalar to multiply by |

### toNormalized

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

```
fun toNormalized(): Vector3
```

Returns the normalized version of this vector. A zero-length vector has no direction to normalize and returns `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3#Zero()` rather than a vector of NaN components.

### toString

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

### unaryMinus

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

```
operator fun unaryMinus(): Vector3
```

Negates this vector.

## Public properties

### length

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

```
val length: Float
```

The length of the vector.

### lengthSquared

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

```
val lengthSquared: Float
```

The squared length of the vector.

### x

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

```
val x: Float
```

the value of the horizontal component

### y

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

```
val y: Float
```

the value of the vertical component

### z

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

```
val z: Float
```

the value of the forward component