# Matrix3x2

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/numerics/struct-matrix3x2/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct Matrix3x2
```

A 3x2 matrix (a two-dimensional affine transform).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L15)

## Members

- [`m11`](#struct_field-m11)
- [`m12`](#struct_field-m12)
- [`m21`](#struct_field-m21)
- [`m22`](#struct_field-m22)
- [`m31`](#struct_field-m31)
- [`m32`](#struct_field-m32)
- [`IDENTITY`](#assoc_const-identity)
- [`new`](#function-new)
- [`is_identity`](#function-is_identity)
- [`translation`](#function-translation)
- [`set_translation`](#function-set_translation)
- [`create_rotation`](#function-create_rotation)
- [`create_rotation_at`](#function-create_rotation_at)
- [`create_scale`](#function-create_scale)
- [`create_scale_xy`](#function-create_scale_xy)
- [`create_scale_uniform`](#function-create_scale_uniform)
- [`create_scale_at`](#function-create_scale_at)
- [`create_skew`](#function-create_skew)
- [`create_skew_at`](#function-create_skew_at)
- [`create_translation`](#function-create_translation)
- [`create_translation_xy`](#function-create_translation_xy)
- [`get_determinant`](#function-get_determinant)
- [`invert`](#function-invert)
- [`invert_or_nan`](#function-invert_or_nan)
- [`lerp`](#function-lerp)

<a id="struct_field-m11"></a>

### m11

```rust
m11: f32
```

The first element of the first row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L17)

<a id="struct_field-m12"></a>

### m12

```rust
m12: f32
```

The second element of the first row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L19)

<a id="struct_field-m21"></a>

### m21

```rust
m21: f32
```

The first element of the second row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L21)

<a id="struct_field-m22"></a>

### m22

```rust
m22: f32
```

The second element of the second row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L23)

<a id="struct_field-m31"></a>

### m31

```rust
m31: f32
```

The first element of the third row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L25)

<a id="struct_field-m32"></a>

### m32

```rust
m32: f32
```

The second element of the third row.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L27)

<a id="assoc_const-identity"></a>

### IDENTITY

```rust
const IDENTITY: Matrix3x2
```

The multiplicative identity matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L32)

<a id="function-new"></a>

### new

```rust
const fn new(m11: f32, m12: f32, m21: f32, m22: f32, m31: f32, m32: f32) -> Self
```

Creates a 3x2 matrix from the specified components.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L36)

<a id="function-is_identity"></a>

### is_identity

```rust
fn is_identity(self: &Self) -> bool
```

Gets a value that indicates whether the current matrix is the identity matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L49)

<a id="function-translation"></a>

### translation

```rust
fn translation(self: &Self) -> Vector2
```

Gets the translation component of this matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L55)

<a id="function-set_translation"></a>

### set_translation

```rust
fn set_translation(self: &mut Self, value: Vector2)
```

Sets the translation component of this matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L61)

<a id="function-create_rotation"></a>

### create_rotation

```rust
fn create_rotation(radians: f32) -> Matrix3x2
```

Creates a rotation matrix using the given rotation in radians.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L67)

<a id="function-create_rotation_at"></a>

### create_rotation_at

```rust
fn create_rotation_at(radians: f32, center_point: Vector2) -> Matrix3x2
```

Creates a rotation matrix using the specified rotation in radians and a center point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L77)

<a id="function-create_scale"></a>

### create_scale

```rust
fn create_scale(scales: Vector2) -> Matrix3x2
```

Creates a scaling matrix from the specified vector scale.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L91)

<a id="function-create_scale_xy"></a>

### create_scale_xy

```rust
fn create_scale_xy(x_scale: f32, y_scale: f32) -> Matrix3x2
```

Creates a scaling matrix from the specified X and Y components.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L97)

<a id="function-create_scale_uniform"></a>

### create_scale_uniform

```rust
fn create_scale_uniform(scale: f32) -> Matrix3x2
```

Creates a scaling matrix that scales uniformly with the given scale.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L103)

<a id="function-create_scale_at"></a>

### create_scale_at

```rust
fn create_scale_at(scales: Vector2, center_point: Vector2) -> Matrix3x2
```

Creates a scaling matrix from the specified vector scale with an offset
from the specified center point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L110)

<a id="function-create_skew"></a>

### create_skew

```rust
fn create_skew(radians_x: f32, radians_y: f32) -> Matrix3x2
```

Creates a skew matrix from the specified angles in radians.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L117)

<a id="function-create_skew_at"></a>

### create_skew_at

```rust
fn create_skew_at(radians_x: f32, radians_y: f32, center_point: Vector2) -> Matrix3x2
```

Creates a skew matrix from the specified angles in radians and a center point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L125)

<a id="function-create_translation"></a>

### create_translation

```rust
fn create_translation(position: Vector2) -> Matrix3x2
```

Creates a translation matrix from the specified 2-dimensional vector.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L137)

<a id="function-create_translation_xy"></a>

### create_translation_xy

```rust
fn create_translation_xy(x_position: f32, y_position: f32) -> Matrix3x2
```

Creates a translation matrix from the specified X and Y components.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L143)

<a id="function-get_determinant"></a>

### get_determinant

```rust
fn get_determinant(self: &Self) -> f32
```

Calculates the determinant for this matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L149)

<a id="function-invert"></a>

### invert

```rust
fn invert(matrix: Matrix3x2) -> Option<Matrix3x2>
```

Tries to invert the specified matrix. Returns `None` when the matrix is
singular; see `Matrix3x2::invert_or_nan` for the value the reference
runtime stores in that case.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L171)

<a id="function-invert_or_nan"></a>

### invert_or_nan

```rust
fn invert_or_nan(matrix: Matrix3x2) -> Matrix3x2
```

Inverts the specified matrix; a singular matrix gives a matrix whose
components are all NaN (the `out` value of the reference runtime).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L194)

<a id="function-lerp"></a>

### lerp

```rust
fn lerp(matrix1: Matrix3x2, matrix2: Matrix3x2, amount: f32) -> Matrix3x2
```

Performs a linear interpolation from one matrix to a second matrix
based on a value that specifies the weighting of the second matrix.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/numerics/matrix3x2.rs#L207)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `Add`
- `Sub`
- `Neg`
- `Mul`
- `Mul<f32>`
- `Display`
- `From<Matrix3x2>`
- `ExpressionVariantValue`
- `BatchValue`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
