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.
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|} $

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>
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 Dec 19 00:13:48 2005 for Visualization by  doxygen 1.4.5