Vector2d

class wpilib.drive.Vector2d(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

This is a 2D vector struct that supports basic vector operations.

Overloaded function.

  1. __init__(self: wpilib.drive._drive.Vector2d) -> None

  2. __init__(self: wpilib.drive._drive.Vector2d, x: float, y: float) -> None

dot(self: wpilib.drive.Vector2d, vec: wpilib.drive.Vector2d) → float

Returns dot product of this vector with argument.

Parameters

vec – Vector with which to perform dot product.

magnitude(self: wpilib.drive.Vector2d) → float

Returns magnitude of vector.

rotate(self: wpilib.drive.Vector2d, angle: float) → None

Rotate a vector in Cartesian space.

Parameters

angle – angle in degrees by which to rotate vector counter-clockwise.

scalarProject(self: wpilib.drive.Vector2d, vec: wpilib.drive.Vector2d) → float

Returns scalar projection of this vector onto argument.

Parameters

vec – Vector onto which to project this vector.

property x
property y