59 return (
v[0] == rhs.
v[0]) && (
v[1] == rhs.
v[1]) && (
v[0] == rhs.
v[1]);
64 return (
v[0] != rhs.
v[0]) || (
v[1] != rhs.
v[1]) || (
v[0] != rhs.
v[1]);
74 return Vector3D(lhs(0) + rhs(0), lhs(1) + rhs(1), lhs(2) + rhs(2));
79 return Vector3D(lhs(0) - rhs(0), lhs(1) - rhs(1), lhs(2) - rhs(2));
84 return Vector3D(lhs(0) * rhs, lhs(1) * rhs, lhs(2) * rhs);
89 return Vector3D(lhs * rhs(0), lhs * rhs(1), lhs * rhs(2));
94 v[0] =
v[1] =
v[2] = 0.0;
107 return v[0] == 0.0 &&
v[1] == 0.0 &&
v[2] == 0.0;
112 return Vector3D(lhs(1) * rhs(2) - lhs(2) * rhs(1),
113 lhs(2) * rhs(0) - lhs(0) * rhs(2),
114 lhs(0) * rhs(1) - lhs(1) * rhs(0));
119 return (lhs(0) * rhs(0) + lhs(1) * rhs(1) + lhs(2) * rhs(2));
Vector3D cross(const Vector3D &lhs, const Vector3D &rhs)
Vector cross product.
Vector3D operator+(const Vector3D &lhs, const Vector3D &rhs)
Add.
Vector3D operator-(const Vector3D &lhs, const Vector3D &rhs)
Subtract.
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Vector3D operator*(const Vector3D &lhs, double rhs)
Multiply.
Vector3D()
Default constructor.
bool operator!=(const Vector3D &) const
Vector3D & operator-=(const Vector3D &vector)
Subtract and assign.
Vector3D & operator*=(double factor)
Scale and assign.
void getComponents(double &x, double &y, double &z) const
Get components.
bool operator==(const Vector3D &) const
Vector3D & operator+=(const Vector3D &vector)
Add and assign.
bool isZero() const
Test for zero.
Vector3D operator-() const
Negative vector.