Vector< T > Class Template Reference

A vector in 3-D space. More...

#include <Vector.h>

Collaboration diagram for Vector< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Vector (T x=0, T y=0, T z=0)
x () const
y () const
z () const
void setX (T x)
void setY (T y)
void setZ (T z)
T * vector ()
const T * vector () const
 operator T * ()
Vector< T > operator+= (const Vector< T > &v)
Vector< T > operator+ (const Vector< T > &v) const
Vector< T > operator-= (const Vector< T > &v)
Vector< T > operator- (const Vector< T > &v) const
Vector< T > operator- () const
Vector< T > operator *= (const Vector< T > &b)
Vector< T > operator * (const Vector< T > &b) const
dotProduct (const Vector< T > &b) const
Vector< T > & operator *= (T scalar)
Vector< T > & operator+= (T scalar)
Vector< T > operator * (T scalar) const
Vector< T > & operator/= (float scalar)
Vector< T > operator/ (float scalar) const
bool operator== (const Vector< T > &v2) const
float len () const
Vector< T > normalized () const
Vector< T > & normalize ()
float angle (const Vector< T > &with) const
 Calculates the angle between this vector and with.
double polarAngle () const
 The angle of this vector in polar coordinates.
bool operator>= (const Vector< T > &b) const
bool operator<= (const Vector< T > &b) const
bool operator< (const Vector< T > &b) const
bool operator> (const Vector< T > &b) const

Private Attributes

mCoords [3]

Detailed Description

template<class T = float>
class Vector< T >

A vector in 3-D space.

This can also be used to represent points. Various functions are provided; vectors generally behave like you would expect.


Constructor & Destructor Documentation

template<class T = float>
Vector< T >::Vector x = 0,
y = 0,
z = 0
[inline]
 


Member Function Documentation

template<class T = float>
float Vector< T >::angle const Vector< T > &  with  )  const [inline]
 

Calculates the angle between this vector and with.

The angle is determined by: $ \cos \phi = \frac{A * B}{|A| * |B|} $

The return value is in radians.

template<class T = float>
T Vector< T >::dotProduct const Vector< T > &  b  )  const [inline]
 

template<class T = float>
float Vector< T >::len  )  const [inline]
 

template<class T = float>
Vector<T>& Vector< T >::normalize  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::normalized  )  const [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator * scalar  )  const [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator * const Vector< T > &  b  )  const [inline]
 

template<class T = float>
Vector<T>& Vector< T >::operator *= scalar  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator *= const Vector< T > &  b  )  [inline]
 

template<class T = float>
Vector< T >::operator T *  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator+ const Vector< T > &  v  )  const [inline]
 

template<class T = float>
Vector<T>& Vector< T >::operator+= scalar  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator+= const Vector< T > &  v  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator-  )  const [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator- const Vector< T > &  v  )  const [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator-= const Vector< T > &  v  )  [inline]
 

template<class T = float>
Vector<T> Vector< T >::operator/ float  scalar  )  const [inline]
 

template<class T = float>
Vector<T>& Vector< T >::operator/= float  scalar  )  [inline]
 

template<class T = float>
bool Vector< T >::operator< const Vector< T > &  b  )  const [inline]
 

template<class T = float>
bool Vector< T >::operator<= const Vector< T > &  b  )  const [inline]
 

template<class T = float>
bool Vector< T >::operator== const Vector< T > &  v2  )  const [inline]
 

template<class T = float>
bool Vector< T >::operator> const Vector< T > &  b  )  const [inline]
 

template<class T = float>
bool Vector< T >::operator>= const Vector< T > &  b  )  const [inline]
 

template<class T = float>
double Vector< T >::polarAngle  )  const [inline]
 

The angle of this vector in polar coordinates.

(The radius is given by length()). The return value is in radians.

template<class T = float>
void Vector< T >::setX x  )  [inline]
 

template<class T = float>
void Vector< T >::setY y  )  [inline]
 

template<class T = float>
void Vector< T >::setZ z  )  [inline]
 

template<class T = float>
const T* Vector< T >::vector  )  const [inline]
 

template<class T = float>
T* Vector< T >::vector  )  [inline]
 

template<class T = float>
T Vector< T >::x  )  const [inline]
 

template<class T = float>
T Vector< T >::y  )  const [inline]
 

template<class T = float>
T Vector< T >::z  )  const [inline]
 


Member Data Documentation

template<class T = float>
T Vector< T >::mCoords[3] [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Jan 23 19:45:10 2006 for Visualization by  doxygen 1.4.6