GameLogic
 All Data Structures Files Functions Variables Friends
Public Member Functions | Data Fields
gameModel::Vector Class Reference

#include <GameModel.h>

Public Member Functions

 Vector (double x, double y)
 
 Vector (const Position &p1, const Position &p2)
 
double abs () const
 
void normalize ()
 
Vector orthogonal () const
 
bool operator== (const Vector &v) const
 
Vector operator* (const double &c) const
 
Vector operator+ (const Vector &v) const
 
Position operator+ (const Position &p) const
 

Data Fields

double x
 x component of the vector.
 
double y
 y component of the vector.
 

Detailed Description

2D vector

Constructor & Destructor Documentation

gameModel::Vector::Vector ( double  x,
double  y 
)

main constructor for the vector.

Parameters
xx component of the vector.
yy component of the vector.

Member Function Documentation

double gameModel::Vector::abs ( ) const

get the euclidean norm of the vector.

Returns
the euclidean norm as double.
void gameModel::Vector::normalize ( )

normalize the vector.

Vector gameModel::Vector::orthogonal ( ) const
Returns
makes the vector orthogonal to its old vector

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