core / com.acmerobotics.roadrunner.geometry / Vector2d

Vector2d

data class Vector2d (source)

Class for representing 2D vectors (x and y).

Constructors

<init>

Class for representing 2D vectors (x and y).

Vector2d(x: Double = 0.0, y: Double = 0.0)

Properties

x

val x: Double

y

val y: Double

Functions

angle

fun angle(): Double

angleBetween

infix fun angleBetween(other: Vector2d): Double

distTo

infix fun distTo(other: Vector2d): Double

div

operator fun div(scalar: Double): Vector2d

dot

infix fun dot(other: Vector2d): Double

epsilonEquals

infix fun epsilonEquals(other: Vector2d): Boolean

minus

operator fun minus(other: Vector2d): Vector2d

norm

fun norm(): Double

plus

operator fun plus(other: Vector2d): Vector2d

projectOnto

infix fun projectOnto(other: Vector2d): Vector2d

rotated

fun rotated(angle: Double): Vector2d

times

operator fun times(scalar: Double): Vector2d

toString

fun toString(): String

unaryMinus

operator fun unaryMinus(): Vector2d

Companion Object Functions

polar

fun polar(r: Double, theta: Double): Vector2d