Hummingbird Framework
 All Classes Functions Variables Modules Pages
hb::Vector2d Class Reference

A 2D vector. More...

#include <Vector2d.h>

Public Member Functions

 Vector2d ()
 Default constructor. More...
 
 Vector2d (double x, double y)
 Contruct a Vector2d from two doubles. More...
 
 Vector2d (const Vector2d &v)
 Copy constructor. More...
 
double module () const
 Get the module of the Vector2d. More...
 
Vector2d normalized () const
 Get the vector normalied. More...
 

Public Attributes

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

Detailed Description

A 2D vector.

A 2d vector of doubles

Constructor & Destructor Documentation

hb::Vector2d::Vector2d ( )
inline

Default constructor.

All values to 0.

hb::Vector2d::Vector2d ( double  x,
double  y 
)
inline

Contruct a Vector2d from two doubles.

Parameters
xValue of x component.
yValue of y component.
hb::Vector2d::Vector2d ( const Vector2d v)
inline

Copy constructor.

Parameters
vOriginal instance.

Member Function Documentation

double hb::Vector2d::module ( ) const
inline

Get the module of the Vector2d.

Returns
Module of the Vector2d.
Vector2d hb::Vector2d::normalized ( ) const
inline

Get the vector normalied.

Returns
A new instance of Vector2d being the normalized version of the original.

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