# MutableAffineTransform

Artifact: [androidx.ink:ink-geometry](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/geometry/MutableAffineTransform.kt+class:androidx.ink.geometry.MutableAffineTransform) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public final class MutableAffineTransform extends AffineTransform
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.ink.geometry.AffineTransform](https://developer.android.com/reference/androidx/ink/geometry/AffineTransform) ||
|   | ↳ | [androidx.ink.geometry.MutableAffineTransform](https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform) |

*** ** * ** ***

A mutable affine transformation in the plane. Individual operations can be populated with methods like `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)`.

See `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` for more general documentation about how these transforms are represented. See `https://developer.android.com/reference/androidx/ink/geometry/ImmutableAffineTransform` for an immutable alternative to this class.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#MutableAffineTransform()()` Constructs an identity `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform`: |
| `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#MutableAffineTransform(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( float m00, float m10, float m20, float m01, float m11, float m21 )` Constructs this transform with 6 float values, starting with the top left corner of the matrix and proceeding in row-major order. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Component-wise equality operator for `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform`. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM00()()` Value in the first row, first column of the transform matrix. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM01()()` Value in the second row, first column of the transform matrix. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM10()()` Value in the first row, second column of the transform matrix. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM11()()` Value in the second row, second column of the transform matrix. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM20()()` Value in the first row, third column of the transform matrix. |
| `float` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#getM21()()` Value in the second row, third column of the transform matrix. |
| `int` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#hashCode()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFrom(androidx.ink.geometry.AffineTransform)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/AffineTransform input)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with the same values contained in `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFrom(androidx.ink.geometry.AffineTransform)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromIdentity()()` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with an identity transformation, which maps a point to itself, i.e. it leaves it unchanged. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)(@https://developer.android.com/reference/androidx/ink/geometry/AngleDegreesFloat float degrees)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that rotates `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)` in the direction from the positive x-axis towards the positive y-axis. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float)(float scaleFactor)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in both the x and y direction by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float)`, centered about the origin. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float,kotlin.Float)(float xScaleFactor, float yScaleFactor)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in both the x- and y-direction by the given pair of factors; `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float,kotlin.Float)` respectively, centered about the origin. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScaleX(kotlin.Float)(float scaleFactor)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in the x-direction by the given factor, centered about the origin. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScaleY(kotlin.Float)(float scaleFactor)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in the y-direction by the given factor, centered about the origin. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromSkewX(kotlin.Float)(float sx)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that skews in the x-direction by the given factor. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromSkewY(kotlin.Float)(float sy)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that skews in the y-direction by the given factor. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(androidx.ink.geometry.Vec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Vec offset)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that translates by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(androidx.ink.geometry.Vec)` vector. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)(float x, float y)` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that translates by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)` offset components. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM00(kotlin.Float)(float value)` Value in the first row, first column of the transform matrix. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM01(kotlin.Float)(float value)` Value in the second row, first column of the transform matrix. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM10(kotlin.Float)(float value)` Value in the first row, second column of the transform matrix. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM11(kotlin.Float)(float value)` Value in the second row, second column of the transform matrix. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM20(kotlin.Float)(float value)` Value in the first row, third column of the transform matrix. |
| `void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setM21(kotlin.Float)(float value)` Value in the second row, third column of the transform matrix. |
| `final void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setValues(kotlin.FloatArray)(@https://developer.android.com/reference/androidx/annotation/Size(min = 6) @https://developer.android.com/reference/androidx/annotation/NonNull float[] values)` Like `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setValues(kotlin.FloatArray)`, but accepts a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` instead of individual float values. |
| `final void` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setValues(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)(float m00, float m10, float m20, float m01, float m11, float m21)` Populates this transform with the given values, starting with the top left corner of the matrix and proceeding in row-major order. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#toImmutable()()` Returns an immutable equivalent of this object. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#toString()()` |

| ### Extension functions |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `https://developer.android.com/reference/androidx/ink/geometry/AndroidGraphicsConverter.https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html matrix )` Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with the values from `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)`. |

### Inherited methods

From [androidx.ink.geometry.AffineTransform](https://developer.android.com/reference/androidx/ink/geometry/AffineTransform) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableParallelogram` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Box)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Box box)`

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableParallelogram` containing the result of applying the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Box)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableParallelogram` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Parallelogram)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Parallelogram parallelogram)`

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableParallelogram` containing the result of applying the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Parallelogram)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Vec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Vec point)`

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` containing the result of applying the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Vec)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableSegment` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Segment)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Segment segment)`

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableSegment` containing the result of applying the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Segment)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableTriangle` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Triangle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Triangle triangle)`

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableTriangle` containing the result of applying the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Triangle)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Box,androidx.ink.geometry.MutableParallelogram)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Box box,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram outParallelogram
)`

Apply the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to the `https://developer.android.com/reference/androidx/ink/geometry/Box` and store the result in the `https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Parallelogram,androidx.ink.geometry.MutableParallelogram)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Parallelogram parallelogram,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram outParallelogram
)`

Apply the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to the `https://developer.android.com/reference/androidx/ink/geometry/Parallelogram` and store the result in the `https://developer.android.com/reference/androidx/ink/geometry/MutableParallelogram`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableVec` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Vec,androidx.ink.geometry.MutableVec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Vec point, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableVec outVec)`

Apply the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to the `https://developer.android.com/reference/androidx/ink/geometry/Vec` and store the result in the `https://developer.android.com/reference/androidx/ink/geometry/MutableVec`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableSegment` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Segment,androidx.ink.geometry.MutableSegment)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Segment segment,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableSegment outSegment
)`

Apply the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to the `https://developer.android.com/reference/androidx/ink/geometry/Segment` and store the result in the `https://developer.android.com/reference/androidx/ink/geometry/MutableSegment`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableTriangle` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#applyTransform(androidx.ink.geometry.Triangle,androidx.ink.geometry.MutableTriangle)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/Triangle triangle,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableTriangle outTriangle
)`

Apply the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` to the `https://developer.android.com/reference/androidx/ink/geometry/Triangle` and store the result in the `https://developer.android.com/reference/androidx/ink/geometry/MutableTriangle`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableAffineTransform` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#computeInverse()()`

Returns the inverse of the `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#computeInverse(androidx.ink.geometry.MutableAffineTransform)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform outAffineTransform)`

Populates `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#computeInverse(androidx.ink.geometry.MutableAffineTransform)` with the inverse of this `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform`.
`final @https://developer.android.com/reference/androidx/annotation/Size(min = 6) @https://developer.android.com/reference/androidx/annotation/NonNull float[]` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#getValues(kotlin.FloatArray)(@https://developer.android.com/reference/androidx/annotation/Size(min = 6) @https://developer.android.com/reference/androidx/annotation/NonNull float[] outArray)`

Populates the first 6 elements of `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#getValues(kotlin.FloatArray)` with the values of this transform, starting with the top left corner of the matrix and proceeding in row-major order.
`final boolean` `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#isAlmostEqual(androidx.ink.geometry.AffineTransform,kotlin.Float)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/AffineTransform other,
@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float tolerance
)`

Compares this `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform` with `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#isAlmostEqual(androidx.ink.geometry.AffineTransform,kotlin.Float)`, and returns true if each component of the transform matrix is within `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#isAlmostEqual(androidx.ink.geometry.AffineTransform,kotlin.Float)` of the corresponding component of `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#isAlmostEqual(androidx.ink.geometry.AffineTransform,kotlin.Float)`.

## Public constructors

### MutableAffineTransform

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

```
public MutableAffineTransform()
```

Constructs an identity `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform`:

```
⎡1  0  0⎤
⎢0  1  0⎥
⎣0  0  1⎦
```

This is useful when pre-allocating a scratch instance to be filled later.

### MutableAffineTransform

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public MutableAffineTransform(
    float m00,
    float m10,
    float m20,
    float m01,
    float m11,
    float m21
)
```

Constructs this transform with 6 float values, starting with the top left corner of the matrix and proceeding in row-major order. Prefer to create this object with functions that apply specific transform operations, such as `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float)` or `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)`, rather than directly passing in the actual numeric values of this transform. This constructor is useful for when the values are needed to be provided all at once, for example for serialization. To access these values in the same order as they are passed in here, use `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#getValues(kotlin.FloatArray)`. To construct this object using an array as input, there is another public constructor for that.

## Public methods

### equals

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

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

Component-wise equality operator for `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform`.

Due to the propagation floating point precision errors, operations that may be equivalent over the real numbers are not always equivalent for floats, and might return false for `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#equals(kotlin.Any)` in some cases.

### getM00

```
public float getM00()
```

Value in the first row, first column of the transform matrix.

### getM01

```
public float getM01()
```

Value in the second row, first column of the transform matrix.

### getM10

```
public float getM10()
```

Value in the first row, second column of the transform matrix.

### getM11

```
public float getM11()
```

Value in the second row, second column of the transform matrix.

### getM20

```
public float getM20()
```

Value in the first row, third column of the transform matrix.

### getM21

```
public float getM21()
```

Value in the second row, third column of the transform matrix.

### hashCode

```
public int hashCode()
```

### populateFrom

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

```
public final @NonNull MutableAffineTransform populateFrom(@NonNull AffineTransform input)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with the same values contained in `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFrom(androidx.ink.geometry.AffineTransform)`.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromIdentity

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

```
public final @NonNull MutableAffineTransform populateFromIdentity()
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with an identity transformation, which maps a point to itself, i.e. it leaves it unchanged.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromRotationDegrees

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

```
public final @NonNull MutableAffineTransform populateFromRotationDegrees(@AngleDegreesFloat float degrees)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that rotates `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)` in the direction from the positive x-axis towards the positive y-axis.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromScale

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

```
public final @NonNull MutableAffineTransform populateFromScale(float scaleFactor)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in both the x and y direction by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float)`, centered about the origin.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromScale

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

```
public final @NonNull MutableAffineTransform populateFromScale(float xScaleFactor, float yScaleFactor)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in both the x- and y-direction by the given pair of factors; `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float,kotlin.Float)` respectively, centered about the origin.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromScaleX

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

```
public final @NonNull MutableAffineTransform populateFromScaleX(float scaleFactor)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in the x-direction by the given factor, centered about the origin.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromScaleY

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

```
public final @NonNull MutableAffineTransform populateFromScaleY(float scaleFactor)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that scales in the y-direction by the given factor, centered about the origin.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromSkewX

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

```
public final @NonNull MutableAffineTransform populateFromSkewX(float sx)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that skews in the x-direction by the given factor.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromSkewY

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

```
public final @NonNull MutableAffineTransform populateFromSkewY(float sy)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that skews in the y-direction by the given factor.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromTranslation

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

```
public final @NonNull MutableAffineTransform populateFromTranslation(@NonNull Vec offset)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that translates by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(androidx.ink.geometry.Vec)` vector.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### populateFromTranslation

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public final @NonNull MutableAffineTransform populateFromTranslation(float x, float y)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with a transformation that translates by the given `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)` and `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromTranslation(kotlin.Float,kotlin.Float)` offset components.

Returns the modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

### setM00

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM00(float value)
```

Value in the first row, first column of the transform matrix.

### setM01

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM01(float value)
```

Value in the second row, first column of the transform matrix.

### setM10

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM10(float value)
```

Value in the first row, second column of the transform matrix.

### setM11

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM11(float value)
```

Value in the second row, second column of the transform matrix.

### setM20

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM20(float value)
```

Value in the first row, third column of the transform matrix.

### setM21

Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
public void setM21(float value)
```

Value in the second row, third column of the transform matrix.

### setValues

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

```
public final void setValues(@Size(min = 6) @NonNull float[] values)
```

Like `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#setValues(kotlin.FloatArray)`, but accepts a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` instead of individual float values.

### setValues

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

```
public final void setValues(float m00, float m10, float m20, float m01, float m11, float m21)
```

Populates this transform with the given values, starting with the top left corner of the matrix and proceeding in row-major order.

Prefer to modify this object with functions that apply specific transform operations, such as `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromScale(kotlin.Float)` or `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform#populateFromRotationDegrees(kotlin.Float)`, rather than directly setting the actual numeric values of this transform. This function is useful for when the values are needed to be provided in bulk, for example for serialization.

To access these values in the same order as they are set here, use `https://developer.android.com/reference/androidx/ink/geometry/AffineTransform#getValues(kotlin.FloatArray)`.

### toImmutable

```
public @NonNull ImmutableAffineTransform toImmutable()
```

Returns an immutable equivalent of this object. This will return itself if called on an immutable instance.

### toString

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

## Extension functions

### AndroidGraphicsConverter.populateFrom

Artifact: [androidx.ink:ink-geometry](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/geometry/AndroidGraphicsConversionExtensions.android.kt+function:populateFrom)

```
public final @NonNull MutableAffineTransform AndroidGraphicsConverter.populateFrom(
    @NonNull MutableAffineTransform receiver,
    @NonNull Matrix matrix
)
```

Fills this `https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` with the values from `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)`.

If `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)` is not an affine transform, throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` instead.

Leaves `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)` unchanged. Returns this modified instance to allow chaining calls.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/MutableAffineTransform` | `this` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.MutableAffineTransform).populateFrom(android.graphics.Matrix)` is not an affine transform. |