Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Vector3D Class Reference

The Vector class represents a 3D vector. More...

#include <Vector3D.h>

List of all members.

Public Methods

 Vector3D ()
 Vector3D (float magx, float magy, float magz)
 Initalizes this vector using rectangular coordinates.

 ~Vector3D ()
 Destructor.

void initRect (float magx, float magy, float magz)
 Initalizes this vector using rectangular coordinates.

void initSphere (float r, float theta, float phi)
 Initalizes this vector using spherical coordinates.

float getMagx () const
 Returns the x component of this vector.

float getMagy () const
 Returns the y component of this vector.

float getMagz () const
 Returns the z component of this vector.

void mult (float scalar)
 Multiplies the magnitude by the given scalar.

void multX (float scalar)
 Multiplies only the X magnitude.

void multY (float scalar)
 Multiplies only the Y magnitude.

void multZ (float scalar)
 Multiplies only the Z magnitude.

void add (const Vector3D &other)
 Vector addition.

Vector3D & operator+= (const Vector3D &rhs)
 Adds the vector rhs to this vector.

void addTo (Point3D &other) const
 Adds the components of this vector to the given point.


Detailed Description

The Vector class represents a 3D vector.

Vectors support addition, spherical coordinates, addition to vectors, addition to Point3D objects, and so on.


Constructor & Destructor Documentation

Vector3D::Vector3D   [inline]
 

Vector3D::Vector3D float    magx,
float    magy,
float    magz
[inline]
 

Initalizes this vector using rectangular coordinates.

Vector3D::~Vector3D   [inline]
 

Destructor.


Member Function Documentation

void Vector3D::add const Vector3D &    other
 

Vector addition.

This is equivalent to operator+=.

void Vector3D::addTo Point3D   other const [inline]
 

Adds the components of this vector to the given point.

This has the effect of "moving" the point.

float Vector3D::getMagx   const [inline]
 

Returns the x component of this vector.

float Vector3D::getMagy   const [inline]
 

Returns the y component of this vector.

float Vector3D::getMagz   const [inline]
 

Returns the z component of this vector.

void Vector3D::initRect float    magx,
float    magy,
float    magz
 

Initalizes this vector using rectangular coordinates.

Authors: Jim Clase, Jonathan Hilliker, Jason Winnebeck

void Vector3D::initSphere float    r,
float    theta,
float    phi
 

Initalizes this vector using spherical coordinates.

Parameters:
r  the distance (magnitude) of the vector.
theta  the angle on the x-y plane off the positive x axis (angle of ascension)
phi  the angle off the positive z axis (angle of declination). an angle of 0 points along the positive z axis, and angle of PI/2 in the x-y plane, and PI points along the negative z axis.

void Vector3D::mult float    scalar
 

Multiplies the magnitude by the given scalar.

void Vector3D::multX float    scalar
 

Multiplies only the X magnitude.

void Vector3D::multY float    scalar
 

Multiplies only the Y magnitude.

void Vector3D::multZ float    scalar
 

Multiplies only the Z magnitude.

Vector3D & Vector3D::operator+= const Vector3D &    rhs
 

Adds the vector rhs to this vector.


The documentation for this class was generated from the following files:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18