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(vec: wpilib.drive.Vector2d)float

Returns dot product of this vector with argument.

Parameters

vec – Vector with which to perform dot product.

magnitude()float

Returns magnitude of vector.

rotate(angle: float)None

Rotate a vector in Cartesian space.

Parameters

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

scalarProject(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