# Quad

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

*** ** * ** ***


```
class Quad
```

<br />

*** ** * ** ***

Represents a 4-point quadrilateral polygon in 2D space.

Can represent mathematically skewed or distorted geometry that breaks strict axis constraints.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#fromCorners(androidx.xr.runtime.math.Vector2,androidx.xr.runtime.math.Vector2,androidx.xr.runtime.math.Vector2,androidx.xr.runtime.math.Vector2)( upperLeft: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2, upperRight: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2, lowerRight: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2, lowerLeft: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2 )` Creates a Quad from 4 explicitly defined corners allowing for arbitrary skew. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#fromMinMax(androidx.xr.runtime.math.Vector2,androidx.xr.runtime.math.Vector2)(min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2, max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2)` Creates a perfectly axis-aligned rectangular Quad. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#lowerLeft()` The bottom-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#lowerRight()` The bottom-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#upperLeft()` The top-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad#upperRight()` The top-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |

## Public companion functions

### fromCorners

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

```
fun fromCorners(
    upperLeft: Vector2,
    upperRight: Vector2,
    lowerRight: Vector2,
    lowerLeft: Vector2
): Quad
```

Creates a Quad from 4 explicitly defined corners allowing for arbitrary skew.

| Parameters |
|---|---|
| `upperLeft: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | The top-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `upperRight: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | The top-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `lowerRight: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | The bottom-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |
| `lowerLeft: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | The bottom-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` | A newly constructed `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` containing the specified geometry. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if any of the provided coordinates contain a NaN float. |

### fromMinMax

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

```
fun fromMinMax(min: Vector2, max: Vector2): Quad
```

Creates a perfectly axis-aligned rectangular Quad.

| Parameters |
|---|---|
| `min: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | A `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` representing the absolute minimum coordinate corner. |
| `max: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` | A `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` representing the absolute maximum coordinate corner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` | A newly constructed `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Quad` encompassing the bounding box limit. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if any coordinate is NaN, or if min bounding coordinates are greater than their respective max bounding coordinates. |

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### lowerLeft

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

```
val lowerLeft: Vector2
```

The bottom-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner.

### lowerRight

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

```
val lowerRight: Vector2
```

The bottom-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner.

### upperLeft

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

```
val upperLeft: Vector2
```

The top-left `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner.

### upperRight

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

```
val upperRight: Vector2
```

The top-right `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector2` corner.