WPILibC++  2020.3.2-60-g3011ebe
frc::Vector2d Struct Reference

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

#include <Vector2d.h>

## Public Member Functions

Vector2d (double x, double y)

void Rotate (double angle)
Rotate a vector in Cartesian space. More...

double Dot (const Vector2d &vec) const
Returns dot product of this vector with argument. More...

double Magnitude () const
Returns magnitude of vector.

double ScalarProject (const Vector2d &vec) const
Returns scalar projection of this vector onto argument. More...

double x = 0.0

double y = 0.0

## Detailed Description

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

## ◆ Dot()

 double frc::Vector2d::Dot ( const Vector2d & vec ) const

Returns dot product of this vector with argument.

Parameters
 vec Vector with which to perform dot product.

## ◆ Rotate()

 void frc::Vector2d::Rotate ( double angle )

Rotate a vector in Cartesian space.

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

## ◆ ScalarProject()

 double frc::Vector2d::ScalarProject ( const Vector2d & vec ) const

Returns scalar projection of this vector onto argument.

Parameters
 vec Vector onto which to project this vector.

The documentation for this struct was generated from the following file:
• /__w/1/s/wpilibc/src/main/native/include/frc/drive/Vector2d.h