20 if (magnitudesSquared < std::numeric_limits<float>::epsilon())
23 float cosTheta = this->
GetDotProduct(rhs) / std::sqrt(magnitudesSquared);
29 else if (cosTheta < -1.f)
43 if (std::fabs(magnitude) < std::numeric_limits<float>::epsilon())
47 phi = std::atan2(
m_y,
m_x);
48 theta = std::acos(
m_z / radius);
57 if (std::fabs(magnitude) < std::numeric_limits<float>::epsilon())
61 phi = std::atan2(
m_y,
m_x);
71 if (std::fabs(magnitude) < std::numeric_limits<float>::epsilon())
82 stream <<
" x: " << cartesianVector.
GetX()
83 <<
" y: " << cartesianVector.
GetY()
84 <<
" z: " << cartesianVector.
GetZ()
Header file for the cartesian vector class.
float m_y
The y coordinate.
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 m_x
The x coordinate.
CartesianVector GetUnitVector() const
Get a unit vector in the direction of the cartesian vector.
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.
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)
StatusCodeException class.
std::ostream & operator<<(std::ostream &stream, const CartesianVector &cartesianVector)
Operator to dump cartesian vector properties to an ostream.