12#ifndef ROOT_TGeoVector3
13#define ROOT_TGeoVector3
44#define Vertex_t_INPLACE_BINARY_OP(OPERATOR) \
45 inline Vertex_t &operator OPERATOR(const Vertex_t &other) \
47 fVec[0] OPERATOR other.fVec[0]; \
48 fVec[1] OPERATOR other.fVec[1]; \
49 fVec[2] OPERATOR other.fVec[2]; \
52 inline Vertex_t &operator OPERATOR(const double &scalar) \
54 fVec[0] OPERATOR scalar; \
55 fVec[1] OPERATOR scalar; \
56 fVec[2] OPERATOR scalar; \
61#undef Vertex_t_INPLACE_BINARY_OP
67 double const &
x()
const {
return fVec[0]; }
70 double const &
y()
const {
return fVec[1]; }
73 double const &
z()
const {
return fVec[2]; }
82 void Set(
double const &
a,
double const &
b,
double const &
c)
100 return left[0] * right[0] + left[1] * right[1] + left[2] * right[2];
107 double Mag2()
const {
return Dot(*
this, *
this); }
138 return Vertex_t(left[1] * right[2] - left[2] * right[1], left[2] * right[0] - left[0] * right[2],
139 left[0] * right[1] - left[1] * right[0]);
150 constexpr double kMinimum = std::numeric_limits<double>::min();
151 const double mag2 =
Mag2();
170#define Vertex_t_BINARY_OP(OPERATOR, INPLACE) \
171 inline Vertex_t operator OPERATOR(const Vertex_t &lhs, const Vertex_t &rhs) \
173 Vertex_t result(lhs); \
174 result INPLACE rhs; \
177 inline Vertex_t operator OPERATOR(Vertex_t const &lhs, const double rhs) \
179 Vertex_t result(lhs); \
180 result INPLACE rhs; \
183 inline Vertex_t operator OPERATOR(const double lhs, Vertex_t const &rhs) \
185 Vertex_t result(lhs); \
186 result INPLACE rhs; \
190#undef Vertex_t_BINARY_OP
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 index
Tessellated::Vertex_t Vertex_t
#define Vertex_t_BINARY_OP(OPERATOR, INPLACE)
std::ostream & operator<<(std::ostream &os, ROOT::Geom::Vertex_t const &vec)
#define Vertex_t_INPLACE_BINARY_OP(OPERATOR)
bool operator!=(Vertex_t const &lhs, Vertex_t const &rhs)
bool operator==(Vertex_t const &lhs, Vertex_t const &rhs)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
double & operator[](const int index)
void Set(double const &a, double const &b, double const &c)
void CopyTo(double *dest) const
bool IsNormalized() const
static Vertex_t Cross(Vertex_t const &left, Vertex_t const &right)
The cross (vector) product of two Vector3D<T> objects.
void Normalize()
Normalizes the vector by dividing each entry by the length.
Vertex_t(const double a=0.)
Vertex_t(const double a, const double b, const double c)
double const & operator[](const int index) const
double Dot(Vertex_t const &right) const
The dot product of two vector.
static double Dot(Vertex_t const &left, Vertex_t const &right)
The dot product of two vector objects.