1 #ifndef CLASSIC_Vector3D_HH
2 #define CLASSIC_Vector3D_HH
41 Vector3D(
double x,
double y,
double z);
133 {
v[0] =
v[1] =
v[2] = 0.0; }
Vector3D cross(const Vector3D &a, const Vector3D &b)
Vector cross product.
Vector3D operator+(const Vector3D &a, const Vector3D &b)
Add.
double dot(const Vector3D &a, const Vector3D &b)
Vector dot product.
Vector3D operator-(const Vector3D &a, const Vector3D &b)
Subtract.
Vector3D operator*(const Vector3D &a, double factor)
Multiply.
void setY(double)
Set component.
Vector3D()
Default constructor.
bool operator!=(const Vector3D &) const
Vector3D & operator-=(const Vector3D &vector)
Subtract and assign.
void setX(double)
Set component.
double getY() const
Get component.
Vector3D & operator*=(double factor)
Scale and assign.
void setZ(double)
Set component.
void getComponents(double &x, double &y, double &z) const
Get components.
double getX() const
Get component.
bool operator==(const Vector3D &) const
Vector3D & operator+=(const Vector3D &vector)
Add and assign.
bool isZero() const
Test for zero.
double getZ() const
Get component.
double & operator()(int i)
Get component.
Vector3D operator-() const
Negative vector.