dlr::numeric::Vector2D Class Reference

The Vector2D class represents a real valued 2D vector. More...

#include <vector2D.h>

List of all members.

Public Member Functions

 Vector2D ()
 The default constructor initializes to (0, 0).
 Vector2D (double x, double y)
 This constructor explicitly sets the 2D coordinates.
 Vector2D (double x, double y, double alpha)
 This constructor explicitly sets 2D homogeneous coordinates.
 Vector2D (const Vector2D &vec)
 The copy constructor deep copies its argument.
 ~Vector2D ()
 The destructor destroys the Vector2D instance.
void setValue (double x, double y)
 This member function explicitly sets the sets coordinates of the Vector2D instance.
void setValue (double x, double y, double alpha)
 This constructor explicitly sets 2D homogeneous coordinates.
double & x ()
 This member function returns the X component of the Vector2D by reference.
double x () const
 This member function returns the X component of the Vector2D by value.
double & y ()
 This member function returns the Y component of the Vector2D by value.
double y () const
 This member function returns the Y component of the Vector2D by value.
Vector2Doperator= (const Vector2D &vec)
 The assignment operator deep copies its argument.
Vector2Doperator *= (double scalar)
 This operator multiplies each component of the Vector2D instance by a scalar.
Vector2Doperator/= (double scalar)
 This operator divides each component of the Vector2D instance by a scalar.
Vector2Doperator+= (const Vector2D &vec)
 This operator adds a scalar to each component of the Vector2D instance.
Vector2Doperator-= (const Vector2D &vec)
 This operator subtracts a scalar from each component of the Vector2D instance.
Vector2D operator- ()
 This operator returns a Vector2D equal to *this, but with each element negated.


Detailed Description

The Vector2D class represents a real valued 2D vector.

Definition at line 28 of file vector2D.h.


Constructor & Destructor Documentation

dlr::numeric::Vector2D::Vector2D (  )  [inline]

The default constructor initializes to (0, 0).

Definition at line 34 of file vector2D.h.

Referenced by operator-().

dlr::numeric::Vector2D::Vector2D ( double  x,
double  y 
) [inline]

This constructor explicitly sets the 2D coordinates.

Parameters:
x The first component of the Vector2D.
y The second component of the Vector2D.

Definition at line 45 of file vector2D.h.

dlr::numeric::Vector2D::Vector2D ( double  x,
double  y,
double  alpha 
) [inline]

This constructor explicitly sets 2D homogeneous coordinates.

The equivalent 2D coordinates are (x/alpha, y/alpha).

Parameters:
x The first component of the Vector2D.
y The second component of the Vector2D.
alpha The projective scale parameter.

Definition at line 59 of file vector2D.h.

dlr::numeric::Vector2D::Vector2D ( const Vector2D vec  )  [inline]

The copy constructor deep copies its argument.

Parameters:
other This argument is the Vector2D instance to be copied.

Definition at line 69 of file vector2D.h.

dlr::numeric::Vector2D::~Vector2D (  )  [inline]

The destructor destroys the Vector2D instance.

Definition at line 76 of file vector2D.h.


Member Function Documentation

void dlr::numeric::Vector2D::setValue ( double  x,
double  y 
) [inline]

This member function explicitly sets the sets coordinates of the Vector2D instance.

Parameters:
x The first component of the Vector2D.
y The second component of the Vector2D.

Definition at line 88 of file vector2D.h.

Referenced by operator=(), and dlr::numeric::operator>>().

void dlr::numeric::Vector2D::setValue ( double  x,
double  y,
double  alpha 
) [inline]

This constructor explicitly sets 2D homogeneous coordinates.

The equivalent 2D coordinates are (x/alpha, y/alpha).

Parameters:
x The first component of the Vector2D.
y The second component of the Vector2D.
alpha The projective scale parameter.

Definition at line 103 of file vector2D.h.

double& dlr::numeric::Vector2D::x (  )  [inline]

This member function returns the X component of the Vector2D by reference.

Returns:
The return value is a reference to the X coordinate.

Definition at line 114 of file vector2D.h.

Referenced by dlr::numeric::AmanatidesWoo2D< ARRAY2D >::AmanatidesWoo2D(), dlr::numeric::bilaterate(), dlr::numeric::dot(), dlr::numeric::magnitudeSquared(), dlr::numeric::operator *(), dlr::numeric::Transform2D::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), and dlr::numeric::operator==().

double dlr::numeric::Vector2D::x (  )  const [inline]

This member function returns the X component of the Vector2D by value.

Returns:
The return value the X coordinate.

Definition at line 123 of file vector2D.h.

double& dlr::numeric::Vector2D::y (  )  [inline]

This member function returns the Y component of the Vector2D by value.

Returns:
The return value the Y coordinate.

Definition at line 132 of file vector2D.h.

Referenced by dlr::numeric::AmanatidesWoo2D< ARRAY2D >::AmanatidesWoo2D(), dlr::numeric::bilaterate(), dlr::numeric::dot(), dlr::numeric::magnitudeSquared(), dlr::numeric::operator *(), dlr::numeric::Transform2D::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), and dlr::numeric::operator==().

double dlr::numeric::Vector2D::y (  )  const [inline]

This member function returns the Y component of the Vector2D by value.

Returns:
The return value the Y coordinate.

Definition at line 141 of file vector2D.h.

Vector2D& dlr::numeric::Vector2D::operator= ( const Vector2D vec  )  [inline]

The assignment operator deep copies its argument.

Parameters:
other This argument is the Vector2D instance to be copied.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 153 of file vector2D.h.

References m_x, m_y, and setValue().

Vector2D& dlr::numeric::Vector2D::operator *= ( double  scalar  )  [inline]

This operator multiplies each component of the Vector2D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to multiply.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 167 of file vector2D.h.

Vector2D& dlr::numeric::Vector2D::operator/= ( double  scalar  )  [inline]

This operator divides each component of the Vector2D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to divide.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 181 of file vector2D.h.

References DLR_THROW.

Vector2D& dlr::numeric::Vector2D::operator+= ( const Vector2D vec  )  [inline]

This operator adds a scalar to each component of the Vector2D instance.

Parameters:
scalar This argument is the scalar to be added.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 199 of file vector2D.h.

References m_x, and m_y.

Vector2D& dlr::numeric::Vector2D::operator-= ( const Vector2D vec  )  [inline]

This operator subtracts a scalar from each component of the Vector2D instance.

Parameters:
scalar This argument is the scalar to be subtracted.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 213 of file vector2D.h.

References m_x, and m_y.

Vector2D dlr::numeric::Vector2D::operator- (  )  [inline]

This operator returns a Vector2D equal to *this, but with each element negated.

Returns:
The return value is a negated copy of *this.

Definition at line 224 of file vector2D.h.

References Vector2D().


The documentation for this class was generated from the following file:
Generated on Mon Jul 9 20:34:21 2007 for dlrLibs Utility Libraries by  doxygen 1.5.2