# ImmutableVec.Companion

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/ImmutableVec.kt+class:androidx.ink.geometry.ImmutableVec.Companion) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public static class ImmutableVec.Companion
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static 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/ImmutableVec#fromDirectionInDegreesAndMagnitude(kotlin.Float,kotlin.Float)( @https://developer.android.com/reference/androidx/ink/geometry/AngleDegreesFloat float directionDegrees, float magnitude )` Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` with the given magnitude and direction in degrees rotated from the positive x-axis in the direction of positive y-axis. |

| ### Extension functions |
|---|---|
| `static 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/AndroidGraphicsConverter.https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec.Companion#(androidx.ink.geometry.ImmutableVec.Companion).from(android.graphics.PointF)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec.Companion receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/PointF.html point )` Constructs an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` with the values from `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.ImmutableVec.Companion).from(android.graphics.PointF)`. |

## Public methods

### fromDirectionInDegreesAndMagnitude

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

```
public static final @NonNull ImmutableVec fromDirectionInDegreesAndMagnitude(
    @AngleDegreesFloat float directionDegrees,
    float magnitude
)
```

Returns an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` with the given magnitude and direction in degrees rotated from the positive x-axis in the direction of positive y-axis.

## Extension functions

### AndroidGraphicsConverter.from

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:from)

```
public static final @NonNull ImmutableVec AndroidGraphicsConverter.from(
    @NonNull ImmutableVec.Companion receiver,
    @NonNull PointF point
)
```

Constructs an `https://developer.android.com/reference/androidx/ink/geometry/ImmutableVec` with the values from `https://developer.android.com/reference/androidx/ink/geometry/package-summary#(androidx.ink.geometry.ImmutableVec.Companion).from(android.graphics.PointF)`.

Java callers should prefer `AndroidGraphicsConverter.createVec(PointF)`(`https://developer.android.com/reference/androidx/ink/geometry/package-summary#createVec(android.graphics.PointF)`).