Template class for 3-vectors of type float, double, …
Allows accessing and changing the elements x, y, z directly or through the corresponding get and set methods.
Angle definitions are phi [-pi, pi]: azimuthal angle in the x-y plane, 0 pointing in x-direction theta [0, pi]: zenith angle towards the z axis, 0 pointing in z-direction
Public Functions
-
inline Vector3()
-
inline Vector3(const Vector3 &v)
-
template<typename U>
inline Vector3(const Vector3<U> &v)
-
inline ~Vector3()
-
inline explicit Vector3(const double *v)
-
inline explicit Vector3(const float *v)
-
inline explicit Vector3(const T &X, const T &Y, const T &Z)
-
inline explicit Vector3(T t)
-
inline void setX(const T X)
-
inline void setY(const T Y)
-
inline void setZ(const T Z)
-
inline void setXYZ(const T X, const T Y, const T Z)
-
inline void setR(const T r)
-
inline void setRThetaPhi(const T r, const T theta, const T phi)
-
inline T getX() const
-
inline T getY() const
-
inline T getZ() const
-
inline T getR() const
-
inline T getR2() const
-
inline T getPhi() const
-
inline T getTheta() const
-
inline Vector3<T> getUnitVector() const
-
inline Vector3<T> getUnitVectorTheta() const
-
inline Vector3<T> getUnitVectorPhi() const
-
inline T getAngleTo(const Vector3<T> &v) const
-
inline bool isParallelTo(const Vector3<T> &v, T maxAngle) const
-
inline T getDistanceTo(const Vector3<T> &point) const
-
inline Vector3<T> getParallelTo(const Vector3<T> &v) const
-
inline Vector3<T> getPerpendicularTo(const Vector3<T> &v) const
-
inline Vector3<T> getRotated(const Vector3<T> &axis, T angle) const
-
inline Vector3<T> clip(T lower, T upper) const
-
inline Vector3<T> abs() const
-
inline Vector3<T> floor() const
-
inline Vector3<T> ceil() const
-
inline T min() const
-
inline T max() const
-
inline T dot(const Vector3<T> &v) const
-
inline Vector3<T> cross(const Vector3<T> &v) const
-
inline bool operator==(const Vector3<T> &v) const
-
inline Vector3<T> operator+(const Vector3<T> &v) const
-
inline Vector3<T> operator+(const T &f) const
-
inline Vector3<T> operator-(const Vector3<T> &v) const
-
inline Vector3<T> operator-(const T &f) const
-
inline Vector3<T> operator*(const Vector3<T> &v) const
-
inline Vector3<T> operator*(T v) const
-
inline Vector3<T> operator/(const Vector3<T> &v) const
-
inline Vector3<T> operator/(const T &f) const
-
inline Vector3<T> operator%(const Vector3<T> &v) const
-
inline Vector3<T> operator%(const T &f) const
-
inline Vector3<T> &operator-=(const Vector3<T> &v)
-
inline Vector3<T> &operator-=(const T &f)
-
inline Vector3<T> &operator+=(const Vector3<T> &v)
-
inline Vector3<T> &operator+=(const T &f)
-
inline Vector3<T> &operator*=(const Vector3<T> &v)
-
inline Vector3<T> &operator*=(const T &f)
-
inline Vector3<T> &operator/=(const Vector3<T> &v)
-
inline Vector3<T> &operator/=(const T &f)
-
inline Vector3<T> &operator%=(const Vector3<T> &v)
-
inline Vector3<T> &operator%=(const T &f)
-
inline Vector3<T> &operator=(const Vector3<T> &v)
-
inline Vector3<T> &operator=(const T &f)
Public Members
-
T x
-
T y
-
T z
-
T data[3]
-
union crpropa::Vector3::[anonymous] [anonymous]