17#ifndef ROOT_Math_GenVector_DisplacementVector2D
18#define ROOT_Math_GenVector_DisplacementVector2D 1
57 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
62 typedef typename CoordSystem::Scalar
Scalar;
86 template <
class OtherCoords>
95 template <
class OtherCoords>
104 template <
class ForeignVector>
117 template <
class OtherCoords>
128 template <
class OtherCoords>
140 template <
class ForeignVector>
289 template<
class OtherCoords >
291 return X()*
v.X() +
Y()*
v.Y();
298 template<
class OtherVector >
300 return X()*
v.x() +
Y()*
v.y();
308 template <
class OtherCoords>
318 template <
class OtherCoords>
396 static constexpr unsigned int fDimension = CoordinateType::Dimension;
401 template <
class OtherCoords,
class OtherTag>
404 template <
class OtherCoords,
class OtherTag>
407 template <
class OtherCoords,
class OtherTag>
411 template <
class OtherCoords,
class OtherTag>
414 template <
class OtherCoords,
class OtherTag>
417 template <
class OtherCoords,
class OtherTag>
420 template<
class OtherCoords,
class OtherTag >
423 template<
class OtherCoords,
class OtherTag >
438 template <
class CoordSystem1,
class CoordSystem2,
class U>
451 template <
class CoordSystem1,
class CoordSystem2,
class U>
466 template <
class CoordSystem,
class U>
484 template<
class char_t,
class traits_t,
class T,
class U >
486 std::basic_ostream<char_t,traits_t> &
487 operator << ( std::basic_ostream<char_t,traits_t> & os
493 typename T::Scalar
a,
b;
494 v.GetCoordinates(
a,
b);
498 typedef GenVector_detail::BitReproducible
BR;
513 template<
class char_t,
class traits_t,
class T,
class U >
515 std::basic_istream<char_t,traits_t> &
522 typename T::Scalar
a,
b;
537 v.SetCoordinates(
a,
b);
543 template <std::
size_t I,
class CoordSystem,
class Tag>
546 static_assert(
I < 2);
547 if constexpr (
I == 0) {
561 template <
class CoordSystem,
class Tag>
562 struct tuple_size<
ROOT::Math::DisplacementVector2D<CoordSystem, Tag>> : integral_constant<size_t, 2> {};
563 template <
size_t I,
class CoordSystem,
class Tag>
565 static_assert(
I < 2);
566 using type =
typename CoordSystem::Scalar;
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 angle
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 2D cartesian coordinate system (x, y coordinates)
Class describing a generic displacement vector in 2 dimensions.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
constexpr DisplacementVector2D(const PositionVector2D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
constexpr DisplacementVector2D()
Default constructor.
DisplacementVector2D Cross(const DisplacementVector2D< OtherCoords, OtherTag > &) const
constexpr DisplacementVector2D(Scalar a, Scalar b)
Construct from three values of type Scalar.
constexpr DisplacementVector2D(const PositionVector2D< OtherCoords, OtherTag > &)
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
DisplacementVector2D & operator=(const DisplacementVector2D< OtherCoords, OtherTag > &)
constexpr DisplacementVector2D(const DisplacementVector2D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
DisplacementVector2D< CoordSystem, Tag > & SetY(Scalar a)
Change Y - Cartesian2D coordinates only.
DisplacementVector2D & operator=(const DisplacementVector2D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector2D operator+() const
Positive of the vector, return itself.
DisplacementVector2D operator-() const
Negative of the vector.
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
constexpr DisplacementVector2D(const ForeignVector &v)
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement metho...
bool operator==(const DisplacementVector2D &rhs) const
Exact equality.
DisplacementVector2D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b)
Set internal data based on 2 Scalar numbers.
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar Dot(const DisplacementVector2D< OtherCoords, OtherTag > &) const
DisplacementVector2D & operator*=(Scalar a)
multiply this vector by a scalar quantity
DisplacementVector2D & operator-=(const DisplacementVector2D< OtherCoords, OtherTag > &)
DisplacementVector2D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar2D coordinates.
DisplacementVector2D & operator+=(const DisplacementVector2D< OtherCoords, OtherTag > &)
constexpr DisplacementVector2D(const DisplacementVector2D< OtherCoords, OtherTag > &)
DisplacementVector2D & operator=(const PositionVector2D< OtherCoords, OtherTag > &)
DisplacementVector2D & operator/=(Scalar a)
divide this vector by a scalar quantity
CoordSystem CoordinateType
bool operator!=(const DisplacementVector2D &rhs) const
static constexpr unsigned int fDimension
DisplacementVector2D unit() const
void Rotate(Scalar angle)
Rotate by an angle.
DisplacementVector2D< CoordSystem, Tag > & SetX(Scalar a)
Change X - Cartesian2D coordinates only.
CoordSystem::Scalar Scalar
DisplacementVector2D< CoordSystem, Tag > & SetR(Scalar a)
Change R - Polar2D coordinates only.
Scalar Dot(const DisplacementVector2D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
void GetCoordinates(Scalar &a, Scalar &b) const
get internal data into 2 Scalar numbers.
DisplacementVector2D operator*(Scalar a) const
Multiply a vector by a real number.
DisplacementVector2D operator/(Scalar a) const
Division of a vector with a real number.
unsigned int Dimension() const
Dimension.
DisplacementVector2D< CoordSystem, Tag > & SetXY(Scalar a, Scalar b)
set the values of the vector from the cartesian components (x,y) (if the vector is held in polar coor...
DisplacementVector2D Unit() const
return unit vector parallel to this
Namespace for new Math classes and functions.
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, 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)
CoordSystem::Scalar get(DisplacementVector2D< CoordSystem, Tag > const &p)
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
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.