Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GVector Class Reference

A basic vector class. More...

#include <gauge3d/3dmath/vector.h>

List of all members.

Public Methods

Constructors
 GVector (void)
 GVector (GCoordinate _x,GCoordinate _y,GCoordinate _z)
 GVector (GCoordinate coords[])
Operators
These are all standard vector math.

const GVector& operator+= (const GVector &other)
 Standard vector add.

const GVector& operator-= (const GVector &other)
 Standard vector subtract.

GCoordinate operator * (const GVector &other)const
 Dot product.

GVector X (const GVector &other)const
 Cross product.

const GVector& operator *= (GCoordinate other)
 Scalar multiplication.

GVector operator/ (GCoordinate div)const
 Scalar division.

const GVector& operator/= (GCoordinate other)
 Scalar division.

GCoordinateoperator[] (int index)
 Array-like access to coordinates.

const GCoordinateoperator[] (int index)const
 Array-like access to coordinates.

bool operator== (const GVector &other)const
 Comparison with error compensation.

bool operator!= (const GVector &other)const
 Comparison with error compensation.

Advanced Ops
GCoordinate Magnitude (void)const
 Find the magnitude (length) of vector.

GCoordinate SquareMagnitude (void)const
 Find the magnitude squared (faster to calculate).

void Normalize (void)
 Make the vector into a unit vector with the same direction.

void Slerp (const GVector &v1,const GVector &v2,GCoordinate t)
 Spherical Linear Interpolation. More...


Public Attributes

Coordinates
GCoordinate x
GCoordinate y
GCoordinate z

Related Functions

(Note that these are not member functions.)

GVector operator+ (const GVector &vec1,const GVector &vec2)
 Vector addition.

GVector operator- (const GVector &vec1,const GVector &vec2)
 Vector subtraction.

GVector operator * (const GVector &vec,GCoordinate coord)
 Vector and scalar multiplication.

GVector operator * (GCoordinate coord,const GVector &vec)
 Vector and scalar multiplication.


Detailed Description

A basic vector class.

This class represents a vector in three dimentional space. Consult your highschool math books for more information. :)


Constructor & Destructor Documentation

GAUGE3D::GVector::GVector ( void ) [inline]
 

Leaves x, y, and z uninitialized.

GAUGE3D::GVector::GVector ( GCoordinate _x,
GCoordinate _y,
GCoordinate _z ) [inline]
 

Initialize to given x, y, and z.

GAUGE3D::GVector::GVector ( GCoordinate coords[] ) [inline, explicit]
 

Initialize from 3-coordinate array containing x, y, and z.


Member Function Documentation

void GAUGE3D::GVector::Slerp ( const GVector & v1,
const GVector & v2,
GCoordinate t )
 

Spherical Linear Interpolation.

Slerp() replaces the vector with the result of a spherical linear interpolation between v1 and v2. Imagin interpolating between two points on the surface of a sphere. The resulting vector will be a unit vector.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000