Vec3D getCylindricalCoordinates() const
Returns the representation of this Vec3D in cylindrical coordinates.
Mdouble X
the vector components
static Vec3D getUnitVector(const Vec3D &a)
Returns a unit Vec3D based on a.
Vec3D getFromCylindricalCoordinates() const
Returns the representation of this Vec3D in cartesian coordinates.
void normalize()
Makes this Vec3D unit length.
void setLength(Mdouble length)
Make this Vec3D a certain length.
Vec3D operator*(const Mdouble a) const
Multiplies by a scalar.
Vec3D & operator-=(const Vec3D &a)
Subtracts another vector.
Vec3D & operator+=(const Vec3D &a)
Adds another vector.
void setZero()
Sets all elements to zero.
static Vec3D sqrt(const Vec3D &a)
Calculates the pointwise square root of a Vec3D.
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Vec3D operator/(const Mdouble a) const
Divides by a scalar.
static Vec3D square(const Vec3D &a)
Calculates the pointwise square of a Vec3D.
bool isEqualTo(const Vec3D &other, const double tol) const
Checks if the length this Vec3D is equal the length of other with a certain tolerance.
bool isZero() const
Checks if ALL elements are zero.
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Vec3D operator+(const Vec3D &a) const
Adds another vector.
static Vec3D min(const Vec3D &a, const Vec3D &b)
Calculates the pointwise minimum of two Vec3D.
friend std::istream & operator>>(std::istream &is, Vec3D &a)
Adds elements to an input stream.
static Mdouble getDistance(const Vec3D &a, const Vec3D &b)
Calculates the distance between two Vec3D: .
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
void setComponent(const int index, const double val)
Sets the requested component of this Vec3D to the requested value.
Vec3D & operator/=(const Mdouble a)
Divides by a scalar.
Mdouble getLength() const
Calculates the length of this Vec3D: .
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Vec3D operator-(const Vec3D &a) const
Subtracts another vector.
Implementation of a 3D vector (by Vitaliy).
Mdouble getComponent(const int index) const
Returns the requested component of this Vec3D.
friend std::ostream & operator<<(std::ostream &os, const Vec3D &a)
Adds elements to an output stream.
static Vec3D max(const Vec3D &a, const Vec3D &b)
Calculates the pointwise maximum of two Vec3D.
Vec3D & operator*=(const Mdouble a)
Multiplies by a scalar.