ImmutableVec
-
android
class ImmutableVec : Vec
An immutable two-dimensional vector, i.e. an (x, y) coordinate pair. It can be used to represent either:
-
A two-dimensional offset, i.e. the difference between two points
-
A point in space, i.e. treating the vector as an offset from the origin
This object is immutable, so it is inherently thread-safe. See MutableVec for a mutable alternative.
Summary
Nested types |
|---|
object ImmutableVec.Companion |
Public companion functions |
||
|---|---|---|
ImmutableVec |
fromDirectionInDegreesAndMagnitude(Returns an |
android
|
Public constructors |
|
|---|---|
ImmutableVec(x: Float, y: Float) |
android
|
Public functions |
||
|---|---|---|
open operator Boolean |
android
|
|
open Int |
hashCode() |
android
|
open String |
toString() |
android
|
Public properties |
||
|---|---|---|
open Float |
The |
android
|
open Float |
The |
android
|
Inherited functions |
||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public companion 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.