Robotcode  1.0
Vector2D Class Reference

class that implements mathematical operations for a 2x1 vector More...

#include <Vector2d.h>

List of all members.

Public Member Functions

 Vector2D (double=0, double=0)
 Create empty.
 Vector2D (const Vector2D &)
 Create by memberwise copy.
Vector2D operator+ (const Vector2D &) const
 Add two vectors.
Vector2D operator- (const Vector2D &) const
 Subtract two vectors.
Vector2D operator* (const double s) const
 Multiply vector by scalar.
Vector2D operator/ (const double s) const
 Divide vector by scalar.
double operator* (const Vector2D &) const
 dot product
double & operator[] (int i)
 Index.
Vector2Doperator= (const Vector2D &)
 Assignment by memberwise copy.
Vector2Doperator-= (const Vector2D &v1)
 minus equal
Vector2Doperator+= (const Vector2D &v1)
 plus equal
Vector2Doperator*= (const Vector2D &v1)
 element by element multiplication
Vector2Doperator*= (double s)
Vector2Doperator/= (const Vector2D &v1)
 element by element division
Vector2Doperator/= (double s)
double norm ()
 Length of the vector.
 operator double * ()

Public Attributes

double x [2]

Friends

double norm (Vector2D)
 Length of the vector.

Detailed Description

class that implements mathematical operations for a 2x1 vector

Most necessary mathematical operations are defined over operator overloading. For some reason the stream operators seem not to work, as there seem to be conflicting definitions somewhere else


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