8#ifndef PANDORA_CARTESIAN_VECTOR_H
9#define PANDORA_CARTESIAN_VECTOR_H 1
50 void SetValues(
float x,
float y,
float z);
352 this->
SetValues(
static_cast<float>(
m_x * scalar),
static_cast<float>(
m_y * scalar),
static_cast<float>(
m_z * scalar));
360 return ( (std::fabs(
m_x - rhs.
m_x) < std::numeric_limits<float>::epsilon()) &&
361 (std::fabs(
m_y - rhs.
m_y) < std::numeric_limits<float>::epsilon()) &&
362 (std::fabs(
m_z - rhs.
m_z) < std::numeric_limits<float>::epsilon()) );
384 return CartesianVector(
static_cast<float>(lhs.
GetX() * scalar),
static_cast<float>(lhs.
GetY() * scalar),
static_cast<float>(lhs.
GetZ() * scalar));
Header file defining status codes and relevant preprocessor macros.
CartesianVector & operator+=(const CartesianVector &rhs)
Cartesian vector += operator.
float m_y
The y coordinate.
void SetValues(float x, float y, float z)
Set the values of cartesian vector components.
float GetCosOpeningAngle(const CartesianVector &rhs) const
Get the cosine of the opening angle of the cartesian vector with respect to a second cartesian vector...
float GetMagnitudeSquared() const
Get the magnitude squared.
float GetX() const
Get the cartesian x coordinate.
void GetSphericalCoordinates(float &radius, float &phi, float &theta) const
Get the spherical coordinates of the cartesian vector.
float GetDistanceSquared(const CartesianVector &rhs) const
Get the distance squared of a cartesian vector with respect to a second cartesian vector.
CartesianVector & operator*=(const double scalar)
Cartesian vector *= operator.
float m_x
The x coordinate.
CartesianVector GetUnitVector() const
Get a unit vector in the direction of the cartesian vector.
bool operator==(const CartesianVector &rhs) const
Cartesian vector == operator.
CartesianVector & operator-=(const CartesianVector &rhs)
Cartesian vector -= operator.
float GetZ() const
Get the cartesian z coordinate.
float GetDotProduct(const CartesianVector &rhs) const
Get the dot product of the cartesian vector with a second cartesian vector.
float GetMagnitude() const
Get the magnitude.
CartesianVector GetCrossProduct(const CartesianVector &rhs) const
Get the cross product of the cartesian vector with a second cartesian vector.
CartesianVector & operator=(const CartesianVector &rhs)
Cartesian vector assignment operator.
float GetOpeningAngle(const CartesianVector &rhs) const
Get the opening angle of the cartesian vector with respect to a second cartesian vector.
CartesianVector(float x, float y, float z)
Constructor, create a vector from the cartesian coordinates of the end point, origin at (0,...
float GetY() const
Get the cartesian y coordinate.
float m_z
The z coordinate.
void GetCylindricalCoordinates(float &radius, float &phi, float &z) const
Get the cylindrical coordinates of the cartesian vector (x/y .. radius, z .. z)
std::ostream & operator<<(std::ostream &stream, const CartesianVector &cartesianVector)
Operator to dump cartesian vector properties to an ostream.
CartesianVector operator+(const CartesianVector &lhs, const CartesianVector &rhs)
Cartesian vector addition operator.
CartesianVector operator*(const CartesianVector &lhs, const double scalar)
Cartesian vector multiplication with scalar operator.
CartesianVector operator-(const CartesianVector &lhs, const CartesianVector &rhs)
Cartesian vector subtraction operator.