# fuchsia.math

<br />

Added: 7

## **STRUCTS**

### Inset

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=356)*

An integer offset to apply to each edge of a rectangle.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `top` | `int32` | The amount to move the top edge of the rectangle towards the center of the rectangle. | No default |
| `right` | `int32` | The amount to move the right edge of the rectangle towards the center of the rectangle. | No default |
| `bottom` | `int32` | The amount to move the bottom edge of the rectangle towards the center of the rectangle. | No default |
| `left` | `int32` | The amount to move the left edge of the rectangle towards the center of the rectangle. | No default |

### InsetF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=379)*

A floating point offset to apply to each edge of a rectangle.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `top` | `float32` | The amount to move the top edge of the rectangle towards the center of the rectangle. | No default |
| `right` | `float32` | The amount to move the right edge of the rectangle towards the center of the rectangle. | No default |
| `bottom` | `float32` | The amount to move the bottom edge of the rectangle towards the center of the rectangle. | No default |
| `left` | `float32` | The amount to move the left edge of the rectangle towards the center of the rectangle. | No default |

### Point

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=12)*

An integer position in a 2D cartesian space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `int32` | The number of units along the x-axis. | No default |
| `y` | `int32` | The number of units along the y-axis. | No default |

### Point3F

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=38)*

A floating point position in a 3D cartesian space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` | The number of units along the x-axis. | No default |
| `y` | `float32` | The number of units along the y-axis. | No default |
| `z` | `float32` | The number of units along the z-axis. | No default |

### PointF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=25)*

A floating point position in a 2D cartesian space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` | The number of units along the x-axis. | No default |
| `y` | `float32` | The number of units along the y-axis. | No default |

### RRectF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=258)*

A floating point rounded rectangle with the custom radii for all four
corners.

A region in a 2D cartesian space consisting of linear, axis-aligned sides
with corners rounded into a quarter ellipse.

If the quarter ellipses in two corners would overlap, their radii are
clamped such that the ellipses meet with an axis-aligned tangent.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` | The location of the origin of the region in the x-axis. | No default |
| `y` | `float32` | The location of the origin of the region in the y-axis. | No default |
| `width` | `float32` | The distance along the x-axis. If `width` is positive, the region includes x values starting at `x` and increasing along the x-axis. If `width` is negative, the region includes x values starting at `x` and decreasing along the x-axis. | No default |
| `height` | `float32` | The distance along the y-axis. If `height` is positive, the region includes y values starting at `y` and increasing along the y-axis. If `height` is negative, the region includes y values starting at `y` and decreasing along the y-axis. | No default |
| `top_left_radius_x` | `float32` | The radius of the quarter ellipse in the top-left corner along the x-axis. Must not be negative. | No default |
| `top_left_radius_y` | `float32` | The radius of the quarter ellipse in the top-left corner along the y-axis. Must not be negative. | No default |
| `top_right_radius_x` | `float32` | The radius of the quarter ellipse in the top-right corner along the x-axis. Must not be negative. | No default |
| `top_right_radius_y` | `float32` | The radius of the quarter ellipse in the top-right corner along the y-axis. Must not be negative. | No default |
| `bottom_left_radius_x` | `float32` | The radius of the quarter ellipse in the bottom-left corner along the x-axis. Must not be negative. | No default |
| `bottom_left_radius_y` | `float32` | The radius of the quarter ellipse in the bottom-left corner along the y-axis. Must not be negative. | No default |
| `bottom_right_radius_x` | `float32` | The radius of the quarter ellipse in the bottom-right corner along the x-axis. Must not be negative. | No default |
| `bottom_right_radius_y` | `float32` | The radius of the quarter ellipse in the bottom-right corner along the y-axis. Must not be negative. | No default |

### RatioU32

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=399)*

A ratio of unsigned 32-bit numbers.
Added: 10

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `numerator` | `uint32` | The numerator. | No default |
| `denominator` | `uint32` | The denominator. | No default |

### RatioU64

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=409)*

A ratio of unsigned 64-bit numbers.
Added: 10

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `numerator` | `uint64` | The numerator. | No default |
| `denominator` | `uint64` | The denominator. | No default |

### Rect

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=169)*

An integral, rectangular, axis-aligned region in a 2D cartesian
space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `int32` | The location of the origin of the rectangle in the x-axis. | No default |
| `y` | `int32` | The location of the origin of the rectangle in the y-axis. | No default |
| `width` | `int32` | The distance along the x-axis. If `width` is positive, the region includes x values starting at `x` and increasing along the x-axis. If `width` is negative, the region includes x values starting at `x` and decreasing along the x-axis. | No default |
| `height` | `int32` | The distance along the y-axis. If `height` is positive, the region includes y values starting at `y` and increasing along the y-axis. If `height` is negative, the region includes y values starting at `y` and decreasing along the y-axis. | No default |

### RectF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=197)*

A floating point, rectangular, axis-aligned region in a 2D cartesian
space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` | The location of the origin of the rectangle in the x-axis. | No default |
| `y` | `float32` | The location of the origin of the rectangle in the y-axis. | No default |
| `width` | `float32` | The distance along the x-axis. If `width` is positive, the region includes x values starting at `x` and increasing along the x-axis. If `width` is negative, the region includes x values starting at `x` and decreasing along the x-axis. | No default |
| `height` | `float32` | The distance along the y-axis. If `height` is positive, the region includes y values starting at `y` and increasing along the y-axis. If `height` is negative, the region includes y values starting at `y` and decreasing along the y-axis. | No default |

### RectU

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=226)*

An integral, rectangular, axis-aligned region in a 2D cartesian
space, with unsigned location and distance fields.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.
Added: 18

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `uint32` | The location of the origin of the rectangle in the x-axis. | No default |
| `y` | `uint32` | The location of the origin of the rectangle in the y-axis. | No default |
| `width` | `uint32` | The distance along the x-axis. The region includes x values starting at `x` and increasing along the x-axis. | No default |
| `height` | `uint32` | The distance along the y-axis. The region includes y values starting at `y` and increasing along the y-axis. | No default |

### Size

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=58)*

The integer dimensions of a rectangular region in a 2D cartesian space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

This type allows for negative dimensions, to which protocols can give
semantics. Protocols that use this type should specify whether negative
dimensions are meaningful, and, if they are meaningful, what they mean.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `width` | `int32` | The distance along the x-axis. | No default |
| `height` | `int32` | The distance along the y-axis. | No default |

### SizeF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=76)*

The floating point dimensions of a rectangular region in a 2D cartesian
space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

This type allows for negative dimensions, to which protocols can give
semantics. Protocols that use this type should specify whether negative
dimensions are meaningful, and, if they are meaningful, what they mean.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `width` | `float32` | The distance along the x-axis. | No default |
| `height` | `float32` | The distance along the y-axis. | No default |

### SizeU

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=90)*

The unsigned integer dimensions of a rectangular region in a 2D cartesian
space.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `width` | `uint32` | The distance along the x-axis. | No default |
| `height` | `uint32` | The distance along the y-axis. | No default |

### Transform

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=334)*

A projective transformation of a 3D cartesian space.

A transform consists of a 4x4 matrix that operates in homogeneous
coordinates. For example, a point located at (x, y, z) in the cartesian
space is transformed by `M` to a point located at (x'/w', y'/w', z'/w'),
where `(x', y', z', w') = M (x, y, z, 1)`.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `matrix` | `array<float32, 16>` | The entries in the transformation matrix in row major order. Specifically, if the matrix is as follows: a b c d e f g h i j k l m n o p then the entries in this array are `(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)`. | No default |

### Vec

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=103)*

Represents a 2D vector with integer coordinates.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `int32` |   | No default |
| `y` | `int32` |   | No default |

### Vec3F

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=130)*

Represents a 3D vector with floating point coordinates.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.
Added: 19

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` |   | No default |
| `y` | `float32` |   | No default |
| `z` | `float32` |   | No default |

### Vec4F

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=147)*

Represents a 4D vector with floating point coordinates.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.
Added: 19

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` |   | No default |
| `y` | `float32` |   | No default |
| `z` | `float32` |   | No default |
| `w` | `float32` |   | No default |

### VecF

*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=116)*

Represents a 2D vector with floating point coordinates.

This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `x` | `float32` |   | No default |
| `y` | `float32` |   | No default |

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [QuaternionF](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=161) | `fuchsia.math/Vec4F` | Added: 19 |