ImmutableVec.Companion



Summary

Public functions

ImmutableVec
fromDirectionInDegreesAndMagnitude(
    directionDegrees: @AngleDegreesFloat Float,
    magnitude: Float
)

Returns an ImmutableVec with the given magnitude and direction in degrees rotated from the positive x-axis in the direction of positive y-axis.

android

Extension functions

ImmutableVec

Constructs an ImmutableVec with the values from point.

android
ImmutableVec

Constructs an ImmutableVec with the values from offset.

android

Public functions

fromDirectionInDegreesAndMagnitude

fun fromDirectionInDegreesAndMagnitude(
    directionDegrees: @AngleDegreesFloat Float,
    magnitude: Float
): ImmutableVec

Returns an ImmutableVec with the given magnitude and direction in degrees rotated from the positive x-axis in the direction of positive y-axis.

Extension functions

from

fun ImmutableVec.Companion.from(point: PointF): ImmutableVec

Constructs an ImmutableVec with the values from point.

Java callers should prefer AndroidGraphicsConverter.createVec(PointF)(createVec).

fun ImmutableVec.Companion.from(offset: Offset): ImmutableVec

Constructs an ImmutableVec with the values from offset.

Performance-sensitive code should use the populateFrom overload that takes a pre-allocated MutableVec, so that instance can be reused across multiple calls.