blob: 5941461406e03665ec5f7e39f44bfa03dfc6bc0a [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.math
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **STRUCTS**
### Inset {#Inset data-text="Inset"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=290)*
<p>An integer offset to apply to each edge of a rectangle.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Inset.top">
<td><code>top</code></td>
<td>
<code>int32</code>
</td>
<td><p>The amount to move the top edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="Inset.right">
<td><code>right</code></td>
<td>
<code>int32</code>
</td>
<td><p>The amount to move the right edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="Inset.bottom">
<td><code>bottom</code></td>
<td>
<code>int32</code>
</td>
<td><p>The amount to move the bottom edge of the rectangle towards the center
of the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="Inset.left">
<td><code>left</code></td>
<td>
<code>int32</code>
</td>
<td><p>The amount to move the left edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
</table>
### InsetF {#InsetF data-text="InsetF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=313)*
<p>A floating point offset to apply to each edge of a rectangle.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="InsetF.top">
<td><code>top</code></td>
<td>
<code>float32</code>
</td>
<td><p>The amount to move the top edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="InsetF.right">
<td><code>right</code></td>
<td>
<code>float32</code>
</td>
<td><p>The amount to move the right edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="InsetF.bottom">
<td><code>bottom</code></td>
<td>
<code>float32</code>
</td>
<td><p>The amount to move the bottom edge of the rectangle towards the center
of the rectangle.</p>
</td>
<td>No default</td>
</tr>
<tr id="InsetF.left">
<td><code>left</code></td>
<td>
<code>float32</code>
</td>
<td><p>The amount to move the left edge of the rectangle towards the center of
the rectangle.</p>
</td>
<td>No default</td>
</tr>
</table>
### Point {#Point data-text="Point"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=12)*
<p>An integer position in a 2D cartesian space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Point.x">
<td><code>x</code></td>
<td>
<code>int32</code>
</td>
<td><p>The number of units along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Point.y">
<td><code>y</code></td>
<td>
<code>int32</code>
</td>
<td><p>The number of units along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### Point3F {#Point3F data-text="Point3F"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=38)*
<p>A floating point position in a 3D cartesian space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Point3F.x">
<td><code>x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The number of units along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Point3F.y">
<td><code>y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The number of units along the y-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Point3F.z">
<td><code>z</code></td>
<td>
<code>float32</code>
</td>
<td><p>The number of units along the z-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### PointF {#PointF data-text="PointF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=25)*
<p>A floating point position in a 2D cartesian space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="PointF.x">
<td><code>x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The number of units along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="PointF.y">
<td><code>y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The number of units along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### RRectF {#RRectF data-text="RRectF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=192)*
<p>A floating point rounded rectangle with the custom radii for all four
corners.</p>
<p>A region in a 2D cartesian space consisting of linear, axis-aligned sides
with corners rounded into a quarter ellipse.</p>
<p>If the quarter ellipses in two corners would overlap, their radii are
clamped such that the ellipses meet with an axis-aligned tangent.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="RRectF.x">
<td><code>x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The location of the origin of the region in the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.y">
<td><code>y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The location of the origin of the region in the y-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.width">
<td><code>width</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the x-axis.</p>
<p>If <code>width</code> is positive, the region includes x values starting at <code>x</code> and
increasing along the x-axis. If <code>width</code> is negative, the region includes
x values starting at <code>x</code> and decreasing along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.height">
<td><code>height</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the y-axis.</p>
<p>If <code>height</code> is positive, the region includes y values starting at <code>y</code>
and increasing along the y-axis. If <code>height</code> is negative, the region
includes y values starting at <code>y</code> and decreasing along the y-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.top_left_radius_x">
<td><code>top_left_radius_x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the top-left corner along the
x-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.top_left_radius_y">
<td><code>top_left_radius_y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the top-left corner along the
y-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.top_right_radius_x">
<td><code>top_right_radius_x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the top-right corner along the
x-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.top_right_radius_y">
<td><code>top_right_radius_y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the top-right corner along the
y-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.bottom_left_radius_x">
<td><code>bottom_left_radius_x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the bottom-left corner along the
x-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.bottom_left_radius_y">
<td><code>bottom_left_radius_y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the bottom-left corner along the
y-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.bottom_right_radius_x">
<td><code>bottom_right_radius_x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the bottom-right corner along the
x-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
<tr id="RRectF.bottom_right_radius_y">
<td><code>bottom_right_radius_y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The radius of the quarter ellipse in the bottom-right corner along the
y-axis.</p>
<p>Must not be negative.</p>
</td>
<td>No default</td>
</tr>
</table>
### RatioU32 {#RatioU32 data-text="RatioU32"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=333)*
<p>A ratio of unsigned 32-bit numbers.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 10</span></div>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="RatioU32.numerator">
<td><code>numerator</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The numerator.</p>
</td>
<td>No default</td>
</tr>
<tr id="RatioU32.denominator">
<td><code>denominator</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The denominator.</p>
</td>
<td>No default</td>
</tr>
</table>
### RatioU64 {#RatioU64 data-text="RatioU64"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=343)*
<p>A ratio of unsigned 64-bit numbers.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 10</span></div>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="RatioU64.numerator">
<td><code>numerator</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The numerator.</p>
</td>
<td>No default</td>
</tr>
<tr id="RatioU64.denominator">
<td><code>denominator</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The denominator.</p>
</td>
<td>No default</td>
</tr>
</table>
### Rect {#Rect data-text="Rect"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=130)*
<p>An integral, rectangular, axis-aligned region in a 2D cartesian
space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Rect.x">
<td><code>x</code></td>
<td>
<code>int32</code>
</td>
<td><p>The location of the origin of the rectangle in the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rect.y">
<td><code>y</code></td>
<td>
<code>int32</code>
</td>
<td><p>The location of the origin of the rectangle in the y-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rect.width">
<td><code>width</code></td>
<td>
<code>int32</code>
</td>
<td><p>The distance along the x-axis.</p>
<p>If <code>width</code> is positive, the region includes x values starting at <code>x</code> and
increasing along the x-axis. If <code>width</code> is negative, the region includes
x values starting at <code>x</code> and decreasing along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rect.height">
<td><code>height</code></td>
<td>
<code>int32</code>
</td>
<td><p>The distance along the y-axis.</p>
<p>If <code>height</code> is positive, the region includes y values starting at <code>y</code>
and increasing along the y-axis. If <code>height</code> is negative, the region
includes y values starting at <code>y</code> and decreasing along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### RectF {#RectF data-text="RectF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=158)*
<p>A floating point, rectangular, axis-aligned region in a 2D cartesian
space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="RectF.x">
<td><code>x</code></td>
<td>
<code>float32</code>
</td>
<td><p>The location of the origin of the rectangle in the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RectF.y">
<td><code>y</code></td>
<td>
<code>float32</code>
</td>
<td><p>The location of the origin of the rectangle in the y-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RectF.width">
<td><code>width</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the x-axis.</p>
<p>If <code>width</code> is positive, the region includes x values starting at <code>x</code> and
increasing along the x-axis. If <code>width</code> is negative, the region includes
x values starting at <code>x</code> and decreasing along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="RectF.height">
<td><code>height</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the y-axis.</p>
<p>If <code>height</code> is positive, the region includes y values starting at <code>y</code>
and increasing along the y-axis. If <code>height</code> is negative, the region
includes y values starting at <code>y</code> and decreasing along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### Size {#Size data-text="Size"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=58)*
<p>The integer dimensions of a rectangular region in a 2D cartesian space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<p>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.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Size.width">
<td><code>width</code></td>
<td>
<code>int32</code>
</td>
<td><p>The distance along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="Size.height">
<td><code>height</code></td>
<td>
<code>int32</code>
</td>
<td><p>The distance along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### SizeF {#SizeF data-text="SizeF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=76)*
<p>The floating point dimensions of a rectangular region in a 2D cartesian
space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<p>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.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="SizeF.width">
<td><code>width</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="SizeF.height">
<td><code>height</code></td>
<td>
<code>float32</code>
</td>
<td><p>The distance along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### SizeU {#SizeU data-text="SizeU"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=90)*
<p>The unsigned integer dimensions of a rectangular region in a 2D cartesian
space.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="SizeU.width">
<td><code>width</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The distance along the x-axis.</p>
</td>
<td>No default</td>
</tr>
<tr id="SizeU.height">
<td><code>height</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The distance along the y-axis.</p>
</td>
<td>No default</td>
</tr>
</table>
### Transform {#Transform data-text="Transform"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=268)*
<p>A projective transformation of a 3D cartesian space.</p>
<p>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 <code>M</code> to a point located at (x'/w', y'/w', z'/w'),
where <code>(x', y', z', w') = M (x, y, z, 1)</code>.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Transform.matrix">
<td><code>matrix</code></td>
<td>
<code>float32[16]</code>
</td>
<td><p>The entries in the transformation matrix in row major order.</p>
<p>Specifically, if the matrix is as follows:</p>
<pre><code>a b c d
e f g h
i j k l
m n o p
</code></pre>
<p>then the entries in this array are
<code>(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)</code>.</p>
</td>
<td>No default</td>
</tr>
</table>
### Vec {#Vec data-text="Vec"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=103)*
<p>Represents a 2D vector with integer coordinates.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Vec.x">
<td><code>x</code></td>
<td>
<code>int32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="Vec.y">
<td><code>y</code></td>
<td>
<code>int32</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### VecF {#VecF data-text="VecF"}
*Defined in [fuchsia.math/math.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.math/math.fidl;l=116)*
<p>Represents a 2D vector with floating point coordinates.</p>
<p>This type does not specify units. Protocols that use this type should
specify the characteristics of the vector space, including orientation and
units.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="VecF.x">
<td><code>x</code></td>
<td>
<code>float32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="VecF.y">
<td><code>y</code></td>
<td>
<code>float32</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>