Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
pandora::CartesianVector Class Reference

CartesianVector class. More...

#include "CartesianVector.h"

Public Member Functions

 CartesianVector (float x, float y, float z)
 Constructor, create a vector from the cartesian coordinates of the end point, origin at (0,0,0,)
 
 CartesianVector (const CartesianVector &rhs)
 Copy constructor.
 
void SetValues (float x, float y, float z)
 Set the values of cartesian vector components.
 
float GetX () const
 Get the cartesian x coordinate.
 
float GetY () const
 Get the cartesian y coordinate.
 
float GetZ () const
 Get the cartesian z coordinate.
 
float GetMagnitude () const
 Get the magnitude.
 
float GetMagnitudeSquared () const
 Get the magnitude squared.
 
float GetDotProduct (const CartesianVector &rhs) const
 Get the dot product of the cartesian vector with a second cartesian vector.
 
CartesianVector GetCrossProduct (const CartesianVector &rhs) const
 Get the cross product of the cartesian vector with a second cartesian vector.
 
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 GetOpeningAngle (const CartesianVector &rhs) const
 Get the opening angle of the cartesian vector with respect to a second cartesian vector.
 
float GetDistanceSquared (const CartesianVector &rhs) const
 Get the distance squared of a cartesian vector with respect to a second cartesian vector.
 
void GetSphericalCoordinates (float &radius, float &phi, float &theta) const
 Get the spherical coordinates of the cartesian vector.
 
void GetCylindricalCoordinates (float &radius, float &phi, float &z) const
 Get the cylindrical coordinates of the cartesian vector (x/y .. radius, z .. z)
 
CartesianVector GetUnitVector () const
 Get a unit vector in the direction of the cartesian vector.
 
CartesianVectoroperator= (const CartesianVector &rhs)
 Cartesian vector assignment operator.
 
CartesianVectoroperator+= (const CartesianVector &rhs)
 Cartesian vector += operator.
 
CartesianVectoroperator-= (const CartesianVector &rhs)
 Cartesian vector -= operator.
 
CartesianVectoroperator*= (const double scalar)
 Cartesian vector *= operator.
 
bool operator== (const CartesianVector &rhs) const
 Cartesian vector == operator.
 

Private Attributes

float m_x
 The x coordinate.
 
float m_y
 The y coordinate.
 
float m_z
 The z coordinate.
 

Detailed Description

CartesianVector class.

Definition at line 23 of file CartesianVector.h.

Constructor & Destructor Documentation

◆ CartesianVector() [1/2]

pandora::CartesianVector::CartesianVector ( float  x,
float  y,
float  z 
)
inline

Constructor, create a vector from the cartesian coordinates of the end point, origin at (0,0,0,)

Parameters
xthe end point x coordinate
ythe end point y coordinate
zthe end point z coordinate

Definition at line 232 of file CartesianVector.h.

◆ CartesianVector() [2/2]

pandora::CartesianVector::CartesianVector ( const CartesianVector rhs)
inline

Copy constructor.

Parameters
rhsthe cartesian vector to copy

Definition at line 241 of file CartesianVector.h.

Member Function Documentation

◆ GetCosOpeningAngle()

float pandora::CartesianVector::GetCosOpeningAngle ( const CartesianVector rhs) const

Get the cosine of the opening angle of the cartesian vector with respect to a second cartesian vector.

Parameters
rhsthe second cartesian vector
Returns
The cosine of the opening angle

Definition at line 16 of file CartesianVector.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCrossProduct()

CartesianVector pandora::CartesianVector::GetCrossProduct ( const CartesianVector rhs) const
inline

Get the cross product of the cartesian vector with a second cartesian vector.

Parameters
rhsthe second cartesian vector
Returns
The cross product

Definition at line 301 of file CartesianVector.h.

Here is the caller graph for this function:

◆ GetCylindricalCoordinates()

void pandora::CartesianVector::GetCylindricalCoordinates ( float &  radius,
float &  phi,
float &  z 
) const

Get the cylindrical coordinates of the cartesian vector (x/y .. radius, z .. z)

Parameters
radiusthe radius (x,y-plane) of the vector
phithe azimuth of the vector
zthe z position of the vector

Definition at line 53 of file CartesianVector.cc.

Here is the call graph for this function:

◆ GetDistanceSquared()

float pandora::CartesianVector::GetDistanceSquared ( const CartesianVector rhs) const
inline

Get the distance squared of a cartesian vector with respect to a second cartesian vector.

Parameters
rhsthe second cartesian vector
Returns
The distance squared

Definition at line 317 of file CartesianVector.h.

Here is the caller graph for this function:

◆ GetDotProduct()

float pandora::CartesianVector::GetDotProduct ( const CartesianVector rhs) const
inline

Get the dot product of the cartesian vector with a second cartesian vector.

Parameters
rhsthe second cartesian vector
Returns
The dot product

Definition at line 294 of file CartesianVector.h.

◆ GetMagnitude()

float pandora::CartesianVector::GetMagnitude ( ) const
inline

Get the magnitude.

Returns
The magnitude

Definition at line 280 of file CartesianVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMagnitudeSquared()

float pandora::CartesianVector::GetMagnitudeSquared ( ) const
inline

Get the magnitude squared.

Returns
The magnitude squared

Definition at line 287 of file CartesianVector.h.

Here is the caller graph for this function:

◆ GetOpeningAngle()

float pandora::CartesianVector::GetOpeningAngle ( const CartesianVector rhs) const
inline

Get the opening angle of the cartesian vector with respect to a second cartesian vector.

Parameters
rhsthe second cartesian vector
Returns
The opening angle

Definition at line 310 of file CartesianVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSphericalCoordinates()

void pandora::CartesianVector::GetSphericalCoordinates ( float &  radius,
float &  phi,
float &  theta 
) const

Get the spherical coordinates of the cartesian vector.

Parameters
radiusthe magnitude of the vector
phithe azimuth of the vector
thetathe inclination of the vector

Definition at line 39 of file CartesianVector.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnitVector()

CartesianVector pandora::CartesianVector::GetUnitVector ( ) const

Get a unit vector in the direction of the cartesian vector.

Returns
The unit vector

Definition at line 67 of file CartesianVector.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetX()

float pandora::CartesianVector::GetX ( ) const
inline

Get the cartesian x coordinate.

Returns
The cartesian x coordinate

Definition at line 259 of file CartesianVector.h.

◆ GetY()

float pandora::CartesianVector::GetY ( ) const
inline

Get the cartesian y coordinate.

Returns
The cartesian y coordinate

Definition at line 266 of file CartesianVector.h.

◆ GetZ()

float pandora::CartesianVector::GetZ ( ) const
inline

Get the cartesian z coordinate.

Returns
The cartesian z coordinate

Definition at line 273 of file CartesianVector.h.

◆ operator*=()

CartesianVector & pandora::CartesianVector::operator*= ( const double  scalar)
inline

Cartesian vector *= operator.

Parameters
scalarthe scalar to multiply

Definition at line 350 of file CartesianVector.h.

Here is the call graph for this function:

◆ operator+=()

CartesianVector & pandora::CartesianVector::operator+= ( const CartesianVector rhs)
inline

Cartesian vector += operator.

Parameters
rhsthe cartesian vector to add

Definition at line 334 of file CartesianVector.h.

Here is the call graph for this function:

◆ operator-=()

CartesianVector & pandora::CartesianVector::operator-= ( const CartesianVector rhs)
inline

Cartesian vector -= operator.

Parameters
rhsthe cartesian vector to subtract

Definition at line 342 of file CartesianVector.h.

Here is the call graph for this function:

◆ operator=()

CartesianVector & pandora::CartesianVector::operator= ( const CartesianVector rhs)
inline

Cartesian vector assignment operator.

Parameters
rhsthe cartesian vector to assign

Definition at line 326 of file CartesianVector.h.

Here is the call graph for this function:

◆ operator==()

bool pandora::CartesianVector::operator== ( const CartesianVector rhs) const
inline

Cartesian vector == operator.

Parameters
rhsthe cartesian vector to compare

Definition at line 358 of file CartesianVector.h.

◆ SetValues()

void pandora::CartesianVector::SetValues ( float  x,
float  y,
float  z 
)
inline

Set the values of cartesian vector components.

Parameters
xthe x coordinate
ythe y coordinate
zthe z coordinate

Definition at line 250 of file CartesianVector.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_x

float pandora::CartesianVector::m_x
private

The x coordinate.

Definition at line 193 of file CartesianVector.h.

◆ m_y

float pandora::CartesianVector::m_y
private

The y coordinate.

Definition at line 194 of file CartesianVector.h.

◆ m_z

float pandora::CartesianVector::m_z
private

The z coordinate.

Definition at line 195 of file CartesianVector.h.


The documentation for this class was generated from the following files: