# opentl::math::Vector2 Class Reference

Special class for vectors with dimension of two. More...

Inherits opentl::math::Vector.

List of all members.

## Public Member Functions
double | abs () const
| calculates the length of this vector
void | calcMaxsOfVectors (const Vector2 &v)
| stores the pairwise maximum of this and another vector
void | calcMinsOfVectors (const Vector2 &v)
| stores the pairwise minimum of this and another vector
double | calcStdDeviation () const
| caclulates the standard deviation of this vector
std::size_t | dimension () const
| get the dimension of this vector (2)
double | dotProduct (const Vector *v2) const
| caclulates the dot product of this vector and another
CvPoint | getCvPoint () const
| Convert this Vector to a CvPoint.
void | normalize ()
| normailize this vector
void | setFromCvPoint (CvPoint &p)
| Convert a CvPoint to this Vector.
| Vector2 (CvPoint &p)
| Constructor taking CvPoint data.
| Vector2 (double x, double y)
| Constructor taking vector data.
| Vector2 (const Matrix &m)
| Constructor based on an existing matrix.
| Vector2 (const Vector2 &m)
| Constructor based on an existing Vector2.
| Vector2 ()
| Constructor.
virtual | ~Vector2 ()
| Destructor.

## Detailed Description

Special class for vectors with dimension of two.

Author:
  Claus Lenz <lenz@in.tum.de>

  Thomas Friedlhuber <friedlhu@in.tum.de>

  Thorsten Roeder <roeder@in.tum.de>

## Constructor & Destructor Documentation

opentl::math::Vector2::Vector2 | ( |  | ) |

Constructor.

opentl::math::Vector2::Vector2 | ( | const Vector2 & | m | ) |

Constructor based on an existing Vector2.

Parameters:

  | m | existing matrix

opentl::math::Vector2::Vector2 | ( | const Matrix & | m | ) | `[explicit]`

Constructor based on an existing matrix.

Parameters:

  | m | existing matrix

opentl::math::Vector2::Vector2 | ( | double | x,
|  | double | y |
| ) |  |  | `[inline]`

Constructor taking vector data.

Parameters:

  | x | vector data
  | y | vector data

opentl::math::Vector2::Vector2 | ( | CvPoint & | p | ) |

Constructor taking CvPoint data.

Parameters:

  | CvPoint | data

virtual opentl::math::Vector2::~Vector2 | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

double opentl::math::Vector2::abs | ( |  | ) | const`[inline]`

calculates the length of this vector

Returns:
  length

void opentl::math::Vector2::calcMaxsOfVectors | ( | const Vector2 & | v | ) | `[inline]`

stores the pairwise maximum of this and another vector

void opentl::math::Vector2::calcMinsOfVectors | ( | const Vector2 & | v | ) | `[inline]`

stores the pairwise minimum of this and another vector

double opentl::math::Vector2::calcStdDeviation | ( |  | ) | const`[inline]`

caclulates the standard deviation of this vector

Returns:
  standard deviation

std::size_t opentl::math::Vector2::dimension | ( |  | ) | const`[inline, virtual]`

get the dimension of this vector (2)

Returns:
  dimension (=2)

Reimplemented from opentl::math::Vector.

double opentl::math::Vector2::dotProduct | ( | const Vector * | v2 | ) | const`[inline]`

caclulates the dot product of this vector and another

Parameters:

  | v2 | the 2nd vector to be used

Returns:
  dot product

CvPoint opentl::math::Vector2::getCvPoint | ( |  | ) | const

Convert this Vector to a CvPoint.

Returns:
  the CvPoint equivalent

void opentl::math::Vector2::normalize | ( |  | ) | `[inline, virtual]`

normailize this vector

Reimplemented from opentl::math::Vector.

void opentl::math::Vector2::setFromCvPoint | ( | CvPoint & | p | ) |

Convert a CvPoint to this Vector.