# FloatSize2d

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

*** ** * ** ***


```
public final class FloatSize2d
```

<br />

*** ** * ** ***

2D size represented as a Float (e.g., panel dimensions in meters).

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#FloatSize2d(kotlin.Float,kotlin.Float)(float width, float height)` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Float)(float divisor)` Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly divided by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Float)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Int)(int divisor)` Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly divided by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Int)`. |
| `boolean` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final float` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#getHeight()()` the height of the object |
| `final float` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#getWidth()()` the width of the object |
| `int` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#hashCode()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Float)(float scalar)` Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly multiplied by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Float)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Int)(int scalar)` Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly multiplied by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Int)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize3d` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#to3d(kotlin.Float)(float depth)` Converts to `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize3d` using `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()`, `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()`, and the given `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#to3d(kotlin.Float)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#toString()()` |

## Public constructors

### FloatSize2d

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

```
public FloatSize2d(float width, float height)
```

## Public methods

### div

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

```
public final @NonNull FloatSize2d div(float divisor)
```

Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly divided by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Float)`.

| Parameters |
|---|---|
| `float divisor` | the value to divide the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()` and `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()` by |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` with the divided dimensions |

### div

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

```
public final @NonNull FloatSize2d div(int divisor)
```

Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly divided by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#div(kotlin.Int)`.

| Parameters |
|---|---|
| `int divisor` | the value to divide the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()` and `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()` by |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` with the divided dimensions |

### equals

```
public boolean equals(Object other)
```

### getHeight

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

```
public final float getHeight()
```

the height of the object

### getWidth

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

```
public final float getWidth()
```

the width of the object

### hashCode

```
public int hashCode()
```

### times

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

```
public final @NonNull FloatSize2d times(float scalar)
```

Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly multiplied by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Float)`.

| Parameters |
|---|---|
| `float scalar` | the value to multiply the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()` and `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()` by |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` with the multiplied dimensions |

### times

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

```
public final @NonNull FloatSize2d times(int scalar)
```

Returns a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` that's uniformly multiplied by the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#times(kotlin.Int)`.

| Parameters |
|---|---|
| `int scalar` | the value to multiply the `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()` and `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()` by |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` with the multiplied dimensions |

### to3d

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

```
public final @NonNull FloatSize3d to3d(float depth)
```

Converts to `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize3d` using `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#width()`, `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#height()`, and the given `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d#to3d(kotlin.Float)`.

| Parameters |
|---|---|
| `float depth` | the depth of the new 3D size |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize3d` | a new `https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize3d` with the specified dimensions |

### toString

```
public @NonNull String toString()
```