Vector3D< T > Class Template Reference

#include <vector3d.h>

List of all members.


Detailed Description

template<class T>
class Vector3D< T >

This class represents a 3D vector.

It is a templated version so the implementation is in the header file.

Definition at line 43 of file vector3d.h.

Public Member Functions

 Vector3D ()
 The default constructor.
 Vector3D (const T x, const T y, const T z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It allows setting the values explicitly.
 Vector3D (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.
 Vector3D (const Point3D< T > point1, const Point3D< T > point2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.
 Vector3D (const Vector3D &v)
 The copy constructor.
 ~Vector3D ()
 The default destructor.
bool isUnit () const
 Returns true if the vector is a unit vector.
bool isZero () const
 Returns true if the vector has zero length.
x () const
 Returns the x-component of the vector.
y () const
 Returns the y-component of the vector.
z () const
 Returns the z-component of the vector.
length () const
 Returns the length of the vector.
void setValues (const T x, const T y, const T z)
 Sets the values of all vector components.
void normalize ()
 Normalizes the vector.
void setLength (const T newLength)
 Sets a new length for the vector.
void changeLength (const T amount)
 Makes the vector amount longer (or shorter if negative).
void invert ()
 Inverts the direction of the vector.
void add (const Vector3D v)
 Adds the vector v to the current vector.
void rotate (const Vector3D axis, const T angle)
 Rotates the vector by the specified angle around the given axis.
void setTorsion (const T angle, const Vector3D refBond, const Vector3D centralBond)
 Changes the orientation of the current vector to give the specified torsion angle with the refBond around the centralBond.
Vector3D cross (const Vector3D v) const
 Calculates the cross product of the vector v and the current vector.
dot (const Vector3D v) const
 Calculates the dot product of the vector v and the current vector.
angle (const Vector3D v) const
 Calculates the angle between the vector v and the current vector.
torsion (const Vector3D v1, const Vector3D v2) const
 Calculates the torsion angle between the current vector and vector v1 around vector v2.

Private Attributes

xVect
yVect
zVect
 The vector values.


Constructor & Destructor Documentation

template<class T>
Vector3D< T >::Vector3D  ) 
 

The default constructor.

Definition at line 87 of file vector3d.h.

template<class T>
Vector3D< T >::Vector3D const T  x,
const T  y,
const T  z
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It allows setting the values explicitly.

Definition at line 94 of file vector3d.h.

template<class T>
Vector3D< T >::Vector3D const T  x1,
const T  y1,
const T  z1,
const T  x2,
const T  y2,
const T  z2
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.

Definition at line 102 of file vector3d.h.

template<class T>
Vector3D< T >::Vector3D const Point3D< T >  point1,
const Point3D< T >  point2
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. It constructs a vector from 2 points.

Definition at line 110 of file vector3d.h.

template<class T>
Vector3D< T >::Vector3D const Vector3D< T > &  v  ) 
 

The copy constructor.

Definition at line 118 of file vector3d.h.

template<class T>
Vector3D< T >::~Vector3D  ) 
 

The default destructor.

Definition at line 127 of file vector3d.h.


Member Function Documentation

template<class T>
bool Vector3D< T >::isUnit  )  const
 

Returns true if the vector is a unit vector.

Definition at line 134 of file vector3d.h.

template<class T>
bool Vector3D< T >::isZero  )  const
 

Returns true if the vector has zero length.

Definition at line 144 of file vector3d.h.

template<class T>
T Vector3D< T >::x  )  const
 

Returns the x-component of the vector.

Definition at line 154 of file vector3d.h.

template<class T>
T Vector3D< T >::y  )  const
 

Returns the y-component of the vector.

Definition at line 161 of file vector3d.h.

template<class T>
T Vector3D< T >::z  )  const
 

Returns the z-component of the vector.

Definition at line 167 of file vector3d.h.

template<class T>
T Vector3D< T >::length  )  const
 

Returns the length of the vector.

Definition at line 174 of file vector3d.h.

template<class T>
void Vector3D< T >::setValues const T  x,
const T  y,
const T  z
 

Sets the values of all vector components.

Definition at line 181 of file vector3d.h.

template<class T>
void Vector3D< T >::normalize  ) 
 

Normalizes the vector.

Definition at line 190 of file vector3d.h.

template<class T>
void Vector3D< T >::setLength const T  newLength  ) 
 

Sets a new length for the vector.

Definition at line 209 of file vector3d.h.

template<class T>
void Vector3D< T >::changeLength const T  amount  ) 
 

Makes the vector amount longer (or shorter if negative).

Definition at line 222 of file vector3d.h.

template<class T>
void Vector3D< T >::invert  ) 
 

Inverts the direction of the vector.

Definition at line 238 of file vector3d.h.

template<class T>
void Vector3D< T >::add const Vector3D< T >  v  ) 
 

Adds the vector v to the current vector.

Definition at line 247 of file vector3d.h.

template<class T>
void Vector3D< T >::rotate const Vector3D< T >  axis,
const T  angle
 

Rotates the vector by the specified angle around the given axis.

Definition at line 256 of file vector3d.h.

template<class T>
void Vector3D< T >::setTorsion const T  angle,
const Vector3D< T >  refBond,
const Vector3D< T >  centralBond
 

Changes the orientation of the current vector to give the specified torsion angle with the refBond around the centralBond.

Warning:
Not implemented yet.

Definition at line 346 of file vector3d.h.

template<class T>
Vector3D< T > Vector3D< T >::cross const Vector3D< T >  v  )  const
 

Calculates the cross product of the vector v and the current vector.

Definition at line 273 of file vector3d.h.

template<class T>
T Vector3D< T >::dot const Vector3D< T >  v  )  const
 

Calculates the dot product of the vector v and the current vector.

Definition at line 284 of file vector3d.h.

template<class T>
T Vector3D< T >::angle const Vector3D< T >  v  )  const
 

Calculates the angle between the vector v and the current vector.

(arccos(dot(v1, v2))). The result is returned in degrees.

Definition at line 291 of file vector3d.h.

template<class T>
T Vector3D< T >::torsion const Vector3D< T >  v1,
const Vector3D< T >  v2
const
 

Calculates the torsion angle between the current vector and vector v1 around vector v2.

The result is returned in degrees.

Definition at line 303 of file vector3d.h.


Member Data Documentation

template<class T>
T Vector3D< T >::xVect [private]
 

Definition at line 79 of file vector3d.h.

template<class T>
T Vector3D< T >::yVect [private]
 

Definition at line 79 of file vector3d.h.

template<class T>
T Vector3D< T >::zVect [private]
 

The vector values.

Definition at line 79 of file vector3d.h.


Generated on Fri May 19 14:31:58 2006 for Brabosphere by  doxygen 1.4.6-NO