iso::math::Vector2< Type > Class Template Reference

2D vector class More...

#include <iso_math_vector2.h>

Inherits iso::math::Vector< Type >< Type >.

Inheritance diagram for iso::math::Vector2< Type >:

Inheritance graph
[legend]
Collaboration diagram for iso::math::Vector2< Type >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Vector2 ()
 create zero vector
 Vector2 (Type pValue)
 create vector with identical vector components
 Vector2 (Type p0, Type p1)
 create vector from parameters
 Vector2 (Type *pValues)
 create vector from array of values
 Vector2 (const Vector2< Type > &pVector)
 create vector from vector
template<class Type2>
 Vector2 (const Vector2< Type2 > &pVector)
 create vector from vector
 Vector2 (const Vector< Type > &pVector) throw (MathException)
 create vector from vector
template<class Type2>
 Vector2 (const Vector< Type2 > &pVector) throw (MathException)
 create vector from vector
virtual ~Vector2 ()
 destructor
virtual void setDim (unsigned int pDim) throw (MathException)
 set dimension of vector
void set (Type p0, Type p1)
 set vector components from parameters
const Vector2< Type > & operator= (const Vector2< Type > &pVector)
 set vector components from vector
const Vector2< Type > & operator= (const Vector< Type > &pVector) throw (MathException)
 set vector components from vector
Type cross (const Vector2 &pVector) const
 vector cross product
void rotate (Type pTheta)
 rotate vector around angle

Static Public Member Functions

static Type cross (const Vector2< Type > &pVector1, const Vector2< Type > &pVector2)
 vector cross product

Public Attributes

Type & x
 references to vector components
Type & y

Static Public Attributes

static const Vector2< Type > ZERO
 zero vector
static const Vector2< Type > ONE
 one vector

Friends

std::ostream & operator<< (std::ostream &pOstream, const Vector2< Type > &pVector)
 print vector information

Detailed Description

template<class Type>
class iso::math::Vector2< Type >

2D vector class

class

Created by Daniel Bisig on 7/16/06. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

template<class Type>
iso::math::Vector2< Type >::Vector2 (  ) 

create zero vector

template<class Type>
iso::math::Vector2< Type >::Vector2 ( Type  pValue  ) 

create vector with identical vector components

Parameters:
pValue value

template<class Type>
iso::math::Vector2< Type >::Vector2 ( Type  p0,
Type  p1 
)

create vector from parameters

Parameters:
p0 0. value
p1 1. value

template<class Type>
iso::math::Vector2< Type >::Vector2 ( Type *  pValues  ) 

create vector from array of values

Parameters:
pValues array of values (must be of correct size)

template<class Type>
iso::math::Vector2< Type >::Vector2 ( const Vector2< Type > &  pVector  ) 

create vector from vector

Parameters:
pVector vector of size 2

template<class Type>
template<class Type2>
iso::math::Vector2< Type >::Vector2 ( const Vector2< Type2 > &  pVector  ) 

create vector from vector

Parameters:
pVector vector of size 2

template<class Type>
iso::math::Vector2< Type >::Vector2 ( const Vector< Type > &  pVector  )  throw (MathException)

create vector from vector

Parameters:
pVector vector
Exceptions:
MathException pVector dimension not 2

template<class Type>
template<class Type2>
iso::math::Vector2< Type >::Vector2 ( const Vector< Type2 > &  pVector  )  throw (MathException)

create vector from vector

Parameters:
pVector vector
Exceptions:
MathException pVector dimension not 2

template<class Type>
iso::math::Vector2< Type >::~Vector2 (  )  [virtual]

destructor


Member Function Documentation

template<class Type>
void iso::math::Vector2< Type >::setDim ( unsigned int  pDim  )  throw (MathException) [virtual]

set dimension of vector

Parameters:
pDim new vector dimension
Exceptions:
MathException illegal function

Reimplemented from iso::math::Vector< Type >.

template<class Type>
void iso::math::Vector2< Type >::set ( Type  p0,
Type  p1 
)

set vector components from parameters

Parameters:
p0 0. value
p1 1. value

template<class Type>
const Vector2< Type > & iso::math::Vector2< Type >::operator= ( const Vector2< Type > &  pVector  ) 

set vector components from vector

Parameters:
pVector of size 2

template<class Type>
const Vector2< Type > & iso::math::Vector2< Type >::operator= ( const Vector< Type > &  pVector  )  throw (MathException)

set vector components from vector

Parameters:
pVector 
Exceptions:
MathException pVector dimension not 2

Reimplemented from iso::math::Vector< Type >.

template<class Type>
Type iso::math::Vector2< Type >::cross ( const Vector2< Type > &  pVector  )  const

vector cross product

Parameters:
pVector second vector
Returns:
cross product
2d version according to Geometric Tools for Computer Graphics, Schneider & Eberly, 2003

template<class Type>
Type iso::math::Vector2< Type >::cross ( const Vector2< Type > &  pVector1,
const Vector2< Type > &  pVector2 
) [static]

vector cross product

Parameters:
pVector1 first vector
pVector2 second vector
Returns:
cross product
2d version according to Geometric Tools for Computer Graphics, Schneider & Eberly, 2003

template<class Type>
void iso::math::Vector2< Type >::rotate ( Type  pTheta  ) 

rotate vector around angle

Parameters:
pTheta angle (in radians)


Friends And Related Function Documentation

template<class Type>
std::ostream& operator<< ( std::ostream &  pOstream,
const Vector2< Type > &  pVector 
) [friend]

print vector information

Parameters:
pOstream output stream
pVector vector
Returns:
output stream


Member Data Documentation

template<class Type>
const Vector2< Type > iso::math::Vector2< Type >::ZERO [static]

zero vector

template<class Type>
const Vector2< Type > iso::math::Vector2< Type >::ONE [static]

one vector

template<class Type>
Type& iso::math::Vector2< Type >::x

references to vector components

template<class Type>
Type & iso::math::Vector2< Type >::y


The documentation for this class was generated from the following file:
Generated on Fri Feb 25 14:04:07 2011 for iso_math by  doxygen 1.5.1