20#ifndef ROOT_MathX_GenVectorX_DisplacementVector3D
21#define ROOT_MathX_GenVectorX_DisplacementVector3D 1
61template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag>
65 typedef typename CoordSystem::Scalar
Scalar;
87 template <
class OtherCoords>
96 template <
class OtherCoords>
105 template <
class ForeignVector>
119 template <
class LAVector>
133 template <
class OtherCoords>
144 template <
class OtherCoords>
155 template <
class ForeignVector>
171 template <
class LAVector>
336 const auto tot =
R();
433 template <
class OtherCoords>
436 return X() *
v.X() +
Y() *
v.Y() +
Z() *
v.Z();
443 template <
class OtherVector>
446 return X() *
v.x() +
Y() *
v.y() +
Z() *
v.z();
455 template <
class OtherCoords>
459 result.SetXYZ(
Y() *
v.Z() -
v.Y() *
Z(),
Z() *
v.X() -
v.Z() *
X(),
X() *
v.Y() -
v.X() *
Y());
468 template <
class OtherVector>
472 result.SetXYZ(
Y() *
v.z() -
v.y() *
Z(),
Z() *
v.x() -
v.z() *
X(),
X() *
v.y() -
v.x() *
Y());
479 template <
class OtherCoords>
489 template <
class OtherCoords>
564#ifdef NOT_SURE_THIS_SHOULD_BE_FORBIDDEN
575 template <
class OtherCoords,
class OtherTag>
580 template <
class OtherCoords,
class OtherTag>
585 template <
class OtherCoords,
class OtherTag>
588 template <
class OtherCoords,
class OtherTag>
591 template <
class OtherCoords,
class OtherTag>
594 template <
class OtherCoords,
class OtherTag>
597 template <
class OtherCoords,
class OtherTag>
600 template <
class OtherCoords,
class OtherTag>
612template <
class CoordSystem1,
class CoordSystem2,
class U>
624template <
class CoordSystem1,
class CoordSystem2,
class U>
636template <
class CoordSystem,
class U>
648#if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
652 class char_t,
class traits_t,
class T,
class U,
653 typename std::enable_if<std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>
::value>
::type * =
nullptr>
654std::basic_ostream<char_t, traits_t> &
659 typename T::Scalar
a,
b,
c;
660 v.GetCoordinates(
a,
b,
c);
677 class char_t,
class traits_t,
class T,
class U,
678 typename std::enable_if<!std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>
::value>
::type * =
nullptr>
679std::basic_ostream<char_t, traits_t> &
685 os <<
"(" <<
v.x()[i] <<
"," <<
v.y()[i] <<
"," <<
v.z()[i] <<
") ";
692template <
class char_t,
class traits_t,
class T,
class U>
693inline std::basic_istream<char_t, traits_t> &
699 typename T::Scalar
a,
b,
c;
718 v.SetCoordinates(
a,
b,
c);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
Class describing a generic displacement vector in 3 dimensions.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
DisplacementVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
DisplacementVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, OtherTag > &) const
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
DisplacementVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector3D unit() const
Scalar Dot(const DisplacementVector3D< OtherCoords, OtherTag > &) const
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
CoordSystem CoordinateType
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
DisplacementVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
DisplacementVector3D operator+() const
Positive of the vector, return itself.
DisplacementVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
DisplacementVector3D operator*(Scalar a) const
Multiply a vector by a real number.
DisplacementVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
bool operator==(const DisplacementVector3D &rhs) const
Exact equality.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
DisplacementVector3D Unit() const
return unit vector parallel to this (scalar)
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
DisplacementVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
DisplacementVector3D & operator=(const PositionVector3D< OtherCoords, OtherTag > &)
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Rho() const
Cylindrical transverse component rho.
DisplacementVector3D(Scalar a, Scalar b, Scalar c)
Construct from three values of type Scalar.
bool operator!=(const DisplacementVector3D &rhs) const
DisplacementVector3D & operator=(const ForeignVector &v)
Assignment from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement meth...
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return vector (cross) product of two displacement vectors, as a vector in the coordinate system of th...
DisplacementVector3D(const DisplacementVector3D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
DisplacementVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
DisplacementVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
DisplacementVector3D()
Default constructor.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
DisplacementVector3D operator-() const
Negative of the vector.
CoordSystem::Scalar Scalar
DisplacementVector3D & operator=(const PositionVector3D< OtherCoords, Tag > &rhs)
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cart...
DisplacementVector3D(const PositionVector3D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
DisplacementVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
DisplacementVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
DisplacementVector3D operator/(Scalar a) const
Division of a vector with a real number.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
DisplacementVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
DisplacementVector3D< CoordSystem, Tag > & SetXYZ(Scalar a, Scalar b, Scalar c)
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or...
DisplacementVector3D Cross(const OtherVector &v) const
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars starting at *begin
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.