TeamCode / org.firstinspires.ftc.teamcode.movement / MecanumDrive / Motor / Vector2D

Vector2D

open class Vector2D

Class representing a 2x1 column vector, used for calculating what speeds to move the motors in.

Constructors

<init>

Vector2D(x: Double, y: Double)

Constructs a vector based on a given x and y.

Properties

x

val x: Double

The first element of the vector. (horizontal movement)

y

val y: Double

The second element of the vector. (vertical movement)

Functions

dotProduct

open static fun dotProduct(a: Vector2D, b: Vector2D): Double

Computes the dot product of two Vector2Ds.

rotatedBy

open fun rotatedBy(angle: Double): Vector2D

Returns a version of the vector rotated by a given angle in radians.