#include <Position.hpp>
Public Types | |
enum class | CoordinateSystem { CARTESIAN , CYLINDRICAL , SPHERICAL } |
Public Member Functions | |
Position () | |
Position (Direction bfk) | |
Position (double r, Direction bfk) | |
Position (double u, double v, double w, CoordinateSystem coordtype) | |
Position (double x, double y, double z) | |
Position (Vec r) | |
void | cartesian (double &x, double &y, double &z) const |
void | cylindrical (double &R, double &phi, double &z) const |
double | cylRadius () const |
double | height () const |
double | radius () const |
void | spherical (double &r, double &theta, double &phi) const |
![]() | |
Vec () | |
Vec (double x, double y, double z) | |
void | clear () |
bool | isNull () const |
double | norm () const |
double | norm2 () const |
Vec & | operator*= (double s) |
Vec & | operator+= (Vec v) |
Vec & | operator-= (Vec v) |
Vec & | operator/= (double s) |
void | set (double x, double y, double z) |
double | x () const |
double | y () const |
double | z () const |
Additional Inherited Members | |
![]() | |
static Vec | cross (Vec a, Vec b) |
static double | dot (Vec a, Vec b) |
![]() | |
double | _x |
double | _y |
double | _z |
An object of the Position class is used to define a position in three-dimensional space. To fully specify a position, three independent coordinates are necessary. Various options are possible. However in this class, a position is internally represented by means of its three cartesian coordinates
|
strong |
This enum has a constant for each of the supported coordinate systems.
|
inline |
The default constructor for the class Position creates a point in the origin of the reference system, with cartesian coordinates
|
inline |
Constructor for a position with given cartesian coordinates
|
inlineexplicit |
Constructor for a position with given cartesian coordinates explicit
to avoid implicit type conversions.
Position::Position | ( | double | u, |
double | v, | ||
double | w, | ||
CoordinateSystem | coordtype | ||
) |
Constructor for a position with three coordinates
If spherical coordinates are used, we assume that
Position::Position | ( | double | r, |
Direction | bfk | ||
) |
Constructor for a position, starting from a radius
|
explicit |
Constructor for a position, starting from only a direction explicit
to avoid implicit type conversions.
void Position::cartesian | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
void Position::cylindrical | ( | double & | R, |
double & | phi, | ||
double & | z | ||
) | const |
This function determines the three cylindrical coordinates
double Position::cylRadius | ( | ) | const |
This function returns the radius of the projection of the position on the XY-plane, which is the radial coordinate in a cylindrical coordinate system. The formula simply reads
Useful in systems with an axial symmetry, where only
double Position::height | ( | ) | const |
This function returns the height of a position above the XY-plane, i.e. the
double Position::radius | ( | ) | const |
void Position::spherical | ( | double & | r, |
double & | theta, | ||
double & | phi | ||
) | const |
This function determines the three spherical coordinates