Darwin Neuroevolution Framework
|
A basic 2D vector. More...
#include <math_2d.h>
Public Member Functions | |
Vector2d () | |
Constructs a zero-vector. | |
Vector2d (Scalar x, Scalar y) | |
Constructs a vector with the specified components. | |
Scalar | length () const |
The magnitude (length) of the vector. | |
Scalar | lengthSquared () const |
Returns the length squared. | |
Vector2d | normalized () const |
Returns a normalized (length = 1) version of this vector. | |
Vector2d | operator+ (const Vector2d &v) const |
Vector addition. | |
Vector2d | operator- (const Vector2d &v) const |
Vector subtraction. | |
Vector2d | operator* (Scalar s) const |
Scalar multiplication. | |
Vector2d | operator/ (Scalar s) const |
Scalar division. | |
Scalar | operator* (const Vector2d &v) const |
Dot product | |
Scalar | cross (const Vector2d &v) const |
A 2d version of the cross product, returning a scalar. | |
Public Attributes | |
Scalar | x |
x coordinate | |
Scalar | y |
y coordinate | |
A basic 2D vector.