#include <Vector3D.h>
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. |
Vectors support addition, spherical coordinates, addition to vectors, addition to Point3D objects, and so on.
|
|
|
Initalizes this vector using rectangular coordinates.
|
|
Destructor.
|
|
Vector addition. This is equivalent to operator+=. |
|
Adds the components of this vector to the given point. This has the effect of "moving" the point. |
|
Returns the x component of this vector.
|
|
Returns the y component of this vector.
|
|
Returns the z component of this vector.
|
|
Initalizes this vector using rectangular coordinates. Authors: Jim Clase, Jonathan Hilliker, Jason Winnebeck |
|
Initalizes this vector using spherical coordinates.
|
|
Multiplies the magnitude by the given scalar.
|
|
Multiplies only the X magnitude.
|
|
Multiplies only the Y magnitude.
|
|
Multiplies only the Z magnitude.
|
|
Adds the vector rhs to this vector.
|