# Vector4

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

*** ** * ** ***


```
class Vector4
```

<br />

*** ** * ** ***

Four-dimensional position in space.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#abs(androidx.xr.runtime.math.Vector4)(vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` 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/Vector4#angleBetween(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)(vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns the angle between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#angleBetween(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#angleBetween(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)` in degrees. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#distance(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)(vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns the distance between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#distance(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#distance(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4.Companion#fromValue(kotlin.Float)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#lerp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, end: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, 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/Vector4.Companion#lerp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#lerp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4,kotlin.Float)` by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#lerp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4,kotlin.Float)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#max(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)(a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns the maximum of each component of the two vectors. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#min(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)(a: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, b: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns the minimum of each component of the two vectors. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#One()` Vector with all components set to one. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#Zero()` Vector with all components set to zero. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#Vector4(androidx.xr.runtime.math.Vector4)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Creates a new vector with the same values as the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#(androidx.xr.runtime.math.Vector4)` vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#Vector4(kotlin.Float,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, w: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#clamp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)(min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4, max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns a new vector with components clamped between `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#clamp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)` and `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#clamp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#copy(kotlin.Float,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, w: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a copy of the vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4#dot(androidx.xr.runtime.math.Vector4)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns the dot product of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#dot(androidx.xr.runtime.math.Vector4)` vector. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Returns true if this vector is equal to the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4#hashCode()()` |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#inverse()()` Returns the component-wise multiplicative inverse of this vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#minus(androidx.xr.runtime.math.Vector4)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns a new vector with the difference of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#minus(androidx.xr.runtime.math.Vector4)` vector. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#plus(androidx.xr.runtime.math.Vector4)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns a new vector with the sum of this vector and the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#plus(androidx.xr.runtime.math.Vector4)` vector. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#scale(androidx.xr.runtime.math.Vector4)(other: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Returns a new vector by component-wise multiplying this vector by `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#scale(androidx.xr.runtime.math.Vector4)`. |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4#toString()()` |
| `operator https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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/Vector4#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/Vector4#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/Vector4#w()` the w 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/Vector4#x()` the x 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/Vector4#y()` the y 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/Vector4#z()` the z component of the vector |

## Public companion functions

### abs

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

```
fun abs(vector: Vector4): Vector4
```

Returns the absolute values of each component of the vector.

| Parameters |
|---|---|
| `vector: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | 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: Vector4, vector2: Vector4): Float
```

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

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

### distance

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

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

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

| Parameters |
|---|---|
| `vector1: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | the first vector |
| `vector2: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | 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): Vector4
```

Creates a new vector with all components set to `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.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: Vector4, end: Vector4, ratio: Float): Vector4
```

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

If `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4.Companion#lerp(androidx.xr.runtime.math.Vector4,androidx.xr.runtime.math.Vector4,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/Vector4` | the starting vector |
| `end: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | 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: Vector4, b: Vector4): Vector4
```

Returns the maximum of each component of the two vectors.

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

### min

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

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

Returns the minimum of each component of the two vectors.

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

## Public companion properties

### One

```
val One: Vector4
```

Vector with all components set to one.

### Zero

```
val Zero: Vector4
```

Vector with all components set to zero.

## Public constructors

### Vector4

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

```
Vector4(other: Vector4)
```

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

### Vector4

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

```
Vector4(x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f, w: 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: Vector4, max: Vector4): Vector4
```

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

| Parameters |
|---|---|
| `min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | the minimum clamp values |
| `max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | 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, w: Float = this.w): Vector4
```

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 |
| `w: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = this.w` | the new w value for the copied vector |

### div

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

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

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: Vector4): Float
```

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

### equals

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

Returns true if this vector is equal to the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4#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(): Vector4
```

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: Vector4): Vector4
```

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

### plus

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

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

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

### scale

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

```
fun scale(other: Vector4): Vector4
```

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

### times

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

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

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(): Vector4
```

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/Vector4#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(): Vector4
```

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.

### w

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

```
val w: Float
```

the w component 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 x component of the vector

### y

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

```
val y: Float
```

the y component of the vector

### z

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

```
val z: Float
```

the z component of the vector