WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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...
 

Public Attributes

double x = 0.0
 
double y = 0.0
 

Detailed Description

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

Member Function Documentation

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

Returns dot product of this vector with argument.

Parameters
vecVector with which to perform dot product.
void frc::Vector2d::Rotate ( double  angle)

Rotate a vector in Cartesian space.

Parameters
angleangle in degrees by which to rotate vector counter-clockwise.
double frc::Vector2d::ScalarProject ( const Vector2d vec) const

Returns scalar projection of this vector onto argument.

Parameters
vecVector onto which to project this vector.

The documentation for this struct was generated from the following file: