17 #ifndef ROOT_Math_GenVector_Plane3D 18 #define ROOT_Math_GenVector_Plane3D 1 20 #include <type_traits> 50 template <
typename T =
double>
74 Plane3D(
const Scalar &
a,
const Scalar &
b,
const Scalar &c,
const Scalar &d) :
fA(a),
fB(b),
fC(c),
fD(d)
93 template <
class T1,
class T2,
class U>
113 template <
class T1,
class T2,
class T3,
class U>
139 Scalar
A()
const {
return fA; }
145 Scalar
B()
const {
return fB; }
151 Scalar
C()
const {
return fC; }
157 Scalar
D()
const {
return fD; }
182 template <
class T1,
class U>
202 template <
class T1,
class U>
221 template <typename SCALAR = T, typename std::enable_if<std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
227 if (s == SCALAR(0)) {
230 const SCALAR w =
Scalar(1) / s;
241 template <typename SCALAR = T, typename std::enable_if<!std::is_arithmetic<SCALAR>::value>::type * =
nullptr>
247 const auto m = (s == SCALAR(0));
251 const SCALAR w = SCALAR(1) / s;
275 const Vector
n = (p2 -
p1).
Cross(p3 - p1);
297 template <
typename T>
298 std::ostream &operator<<(std::ostream &os, const Plane3D<T> &p)
301 << p.Normal().X() <<
" " << p.Normal().Y() <<
" " << p.Normal().Z() <<
" " << p.HesseDistance() <<
"\n";
Plane3D(const DisplacementVector3D< T1, U > &n, const PositionVector3D< T2, U > &p)
Construct from a generic DisplacementVector3D (normal vector) and PositionVector3D (point coplanar to...
Scalar HesseDistance() const
Return the Hesse Distance (distance from the origin) of the plane or the d coefficient expressed in n...
PositionVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > Point
static double p3(double t, double a, double b, double c, double d)
Scalar Distance(const PositionVector3D< T1, U > &p) const
Return the distance to a Point described with generic coordinates.
Namespace for new ROOT classes and functions.
Vector Normal() const
Return normal vector to the plane as Cartesian DisplacementVector.
void Normalize()
Normalize the normal (a,b,c) plane components.
Class describing a generic position vector (point) in 3 dimensions.
Scalar D() const
Return the d coefficient of the plane equation .
Scalar B() const
Return the b coefficient of the plane equation .
bool operator!=(const Plane3D &rhs) const
void BuildFromVecAndPoint(const Vector &n, const Point &p)
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
bool operator==(const Plane3D &rhs) const
Exact equality.
Plane3D()
default constructor create plane z = 0
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
static double p2(double t, double a, double b, double c)
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Class describing a generic displacement vector in 3 dimensions.
Plane3D(const PositionVector3D< T1, U > &p1, const PositionVector3D< T2, U > &p2, const PositionVector3D< T3, U > &p3)
constructor from three generic point belonging to the plane
Plane3D(const Point &p1, const Point &p2, const Point &p3)
constructor from three Cartesian point belonging to the plane
DisplacementVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > Vector
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
static double p1(double t, double a, double b)
Impl::Plane3D< float > Plane3DF
SVector< T, 3 > Cross(const SVector< T, 3 > &lhs, const SVector< T, 3 > &rhs)
Vector Cross Product (only for 3-dim vectors) .
Plane3D & operator=(const Plane3D &plane)
Assignment operator from other Plane3D class.
Namespace for new Math classes and functions.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Plane3D(const Scalar &a, const Scalar &b, const Scalar &c, const Scalar &d)
generic constructors from the four scalar values describing the plane according to the equation ax + ...
Scalar C() const
Return the c coefficient of the plane equation .
Scalar Distance(const Point &p) const
Return the signed distance to a Point.
Plane3D(const Vector &n, const Point &p)
constructor a Plane3D from a normal vector and a point coplanar to the plane
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void BuildFrom3Points(const Point &p1, const Point &p2, const Point &p3)
Scalar A() const
Return the a coefficient of the plane equation .
Class describing a geometrical plane in 3 dimensions.
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
Point ProjectOntoPlane(const Point &p) const
Return the projection of a Cartesian point to a plane.
PositionVector3D< T1, U > ProjectOntoPlane(const PositionVector3D< T1, U > &p) const
Return the projection of a point to a plane.
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZPoint
3D Point based on the cartesian coordinates x,y,z in double precision