17#ifndef ROOT_MathX_GenVectorX_Plane3D
18#define ROOT_MathX_GenVectorX_Plane3D 1
50template <
typename T =
double>
93 template <
class T1,
class T2,
class U>
113 template <
class T1,
class T2,
class T3,
class U>
176 template <
class T1,
class U>
196 template <
class T1,
class U>
215 template <typename SCALAR = T, typename std::enable_if<std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
222 if (s == SCALAR(0)) {
225 const SCALAR w =
Scalar(1) / s;
236 template <typename SCALAR = T, typename std::enable_if<!std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
243 const auto m = (s == SCALAR(0));
245 where(
m, s) = SCALAR(1);
246 where(
m,
fD) = SCALAR(0);
247 const SCALAR w = SCALAR(1) / s;
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
Class describing a generic displacement vector in 3 dimensions.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Class describing a geometrical plane in 3 dimensions.
Scalar Distance(const Point &p) const
Return the signed distance to a Point.
Plane3D(const Plane3D &)=default
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...
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 + ...
void BuildFromVecAndPoint(const Vector &n, const Point &p)
DisplacementVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > Vector
Point ProjectOntoPlane(const Point &p) const
Return the projection of a Cartesian point to a plane.
void Normalize()
Normalize the normal (a,b,c) plane components.
Plane3D & operator=(const Plane3D &)=default
Assignment operator from other Plane3D class.
void BuildFrom3Points(const Point &p1, const Point &p2, const Point &p3)
bool operator==(const Plane3D &rhs) const
Exact equality.
PositionVector3D< T1, U > ProjectOntoPlane(const PositionVector3D< T1, U > &p) const
Return the projection of a point to a plane.
PositionVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > Point
Plane3D(const Point &p1, const Point &p2, const Point &p3)
constructor from three Cartesian point belonging to the plane
Scalar C() const
Return the c coefficient of the plane equation .
Plane3D(const Vector &n, const Point &p)
constructor a Plane3D from a normal vector and a point coplanar to the plane
Scalar Distance(const PositionVector3D< T1, U > &p) const
Return the distance to a Point described with generic coordinates.
Scalar B() const
Return the b coefficient of the plane equation .
Scalar A() const
Return the a coefficient of the plane equation .
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
bool operator!=(const Plane3D &rhs) const
Plane3D()
default constructor create plane z = 0
Vector Normal() const
Return normal vector to the plane as Cartesian DisplacementVector.
Scalar D() const
Return the d coefficient of the plane equation .
Class describing a generic position vector (point) in 3 dimensions.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
std::ostream & operator<<(std::ostream &os, const Plane3D< T > &p)
Stream Output and Input.
Impl::Plane3D< float > Plane3DF
PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZPoint
3D Point based on the cartesian coordinates x,y,z in double precision
Impl::Plane3D< double > Plane3D