Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Vector2D Class Reference

A Vector2D is a line (without a defined start point) in a 2 dimensional space and is deccribed by its x- and y component. More...

#include <weatherarea.h>

List of all members.

Public Member Functions

 Vector2D ()
 Default constructor.
 Vector2D (int x, int y)
 Constructor for creating a new vector.
 ~Vector2D ()
 Destructor.
int getXComponent () const
 Retrieves the xComponent of the Vector.
int getYComponent () const
 Retrieves the yComponent of the Vector.
double getLength () const
 Calculates the length of the vector (Pythagoras).
bool isZeroVector () const
 Checks if the vector is the zero-vector.


Detailed Description

A Vector2D is a line (without a defined start point) in a 2 dimensional space and is deccribed by its x- and y component.

Author:
Kevin Hirschmann

Definition at line 33 of file weatherarea.h.


Constructor & Destructor Documentation

Vector2D::Vector2D  ) 
 

Default constructor.

Definition at line 30 of file weatherarea.cpp.

Vector2D::Vector2D int  x,
int  y
 

Constructor for creating a new vector.

Parameters:
x The xComponent
y The yComponent

Definition at line 32 of file weatherarea.cpp.

Vector2D::~Vector2D  ) 
 

Destructor.

Definition at line 34 of file weatherarea.cpp.


Member Function Documentation

double Vector2D::getLength  )  const
 

Calculates the length of the vector (Pythagoras).

Returns:
The length of the Vector

Definition at line 43 of file weatherarea.cpp.

int Vector2D::getXComponent  )  const
 

Retrieves the xComponent of the Vector.

Returns:
the xComponent

Definition at line 36 of file weatherarea.cpp.

Referenced by WeatherField::move(), and WeatherArea::write().

int Vector2D::getYComponent  )  const
 

Retrieves the yComponent of the Vector.

Returns:
the yComponent

Definition at line 40 of file weatherarea.cpp.

Referenced by WeatherField::move(), and WeatherArea::write().

bool Vector2D::isZeroVector  )  const
 

Checks if the vector is the zero-vector.

Returns:
true if x- and yComponent == 0; flase otherwise

Definition at line 47 of file weatherarea.cpp.

Referenced by WeatherArea::update().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:22:14 2008 for Advanced Strategic Command by  doxygen 1.4.2