Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::Impl::Plane3D< T > Class Template Reference

template<typename T = double>
class ROOT::Math::Impl::Plane3D< T >

Class describing a geometrical plane in 3 dimensions.

A Plane3D is a 2 dimensional surface spanned by two linearly independent vectors. The plane is described by the equation \( a*x + b*y + c*z + d = 0 \) where (a,b,c) are the components of the normal vector to the plane \( n = (a,b,c) \) and \( d = - n \dot x \), where x is any point belonging to plane. More information on the mathematics describing a plane in 3D is available on MathWord. The Plane3D class contains the 4 scalar values in T which represent the four coefficients, fA, fB, fC, fD. fA, fB, fC are the normal components normalized to 1, i.e. fA**2 + fB**2 + fC**2 = 1

Definition at line 51 of file Plane3D.h.

Public Types

typedef PositionVector3D< Cartesian3D< T >, DefaultCoordinateSystemTagPoint
 
typedef T Scalar
 
typedef DisplacementVector3D< Cartesian3D< T >, DefaultCoordinateSystemTagVector
 

Public Member Functions

 Plane3D ()
 default constructor create plane z = 0
 
template<class T1 , class T2 , class U >
 Plane3D (const DisplacementVector3D< T1, U > &n, const PositionVector3D< T2, U > &p)
 Construct from a generic DisplacementVector3D (normal vector) and PositionVector3D (point coplanar to the plane)
 
 Plane3D (const Plane3D &)=default
 
 Plane3D (const Point &p1, const Point &p2, const Point &p3)
 constructor from three Cartesian point belonging to the plane
 
template<class T1 , class T2 , class T3 , class U >
 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 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 + by + cz + d = 0
 
 Plane3D (const Vector &n, const Point &p)
 constructor a Plane3D from a normal vector and a point coplanar to the plane
 
Scalar A () const
 Return the a coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).
 
Scalar B () const
 Return the b coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).
 
Scalar C () const
 Return the c coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).
 
Scalar D () const
 Return the d coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).
 
Scalar Distance (const Point &p) const
 Return the signed distance to a Point.
 
template<class T1 , class U >
Scalar Distance (const PositionVector3D< T1, U > &p) const
 Return the distance to a Point described with generic coordinates.
 
Scalar HesseDistance () const
 Return the Hesse Distance (distance from the origin) of the plane or the d coefficient expressed in normalize form.
 
Vector Normal () const
 Return normal vector to the plane as Cartesian DisplacementVector.
 
bool operator!= (const Plane3D &rhs) const
 
Plane3Doperator= (const Plane3D &)=default
 Assignment operator from other Plane3D class.
 
bool operator== (const Plane3D &rhs) const
 Exact equality.
 
Point ProjectOntoPlane (const Point &p) const
 Return the projection of a Cartesian point to a plane.
 
template<class T1 , class U >
PositionVector3D< T1, U > ProjectOntoPlane (const PositionVector3D< T1, U > &p) const
 Return the projection of a point to a plane.
 

Protected Member Functions

template<typename SCALAR = T, typename std::enable_if< std::is_arithmetic< SCALAR >::value >::type * = nullptr>
void Normalize ()
 Normalize the normal (a,b,c) plane components.
 
template<typename SCALAR = T, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr>
void Normalize ()
 Normalize the normal (a,b,c) plane components.
 

Private Member Functions

void BuildFrom3Points (const Point &p1, const Point &p2, const Point &p3)
 
void BuildFromVecAndPoint (const Vector &n, const Point &p)
 

Private Attributes

Scalar fA
 
Scalar fB
 
Scalar fC
 
Scalar fD
 

#include <Math/GenVector/Plane3D.h>

Member Typedef Documentation

◆ Point

template<typename T = double>
typedef PositionVector3D<Cartesian3D<T>, DefaultCoordinateSystemTag> ROOT::Math::Impl::Plane3D< T >::Point

Definition at line 59 of file Plane3D.h.

◆ Scalar

template<typename T = double>
typedef T ROOT::Math::Impl::Plane3D< T >::Scalar

Definition at line 56 of file Plane3D.h.

◆ Vector

template<typename T = double>
typedef DisplacementVector3D<Cartesian3D<T>, DefaultCoordinateSystemTag> ROOT::Math::Impl::Plane3D< T >::Vector

Definition at line 58 of file Plane3D.h.

Constructor & Destructor Documentation

◆ Plane3D() [1/7]

template<typename T = double>
ROOT::Math::Impl::Plane3D< T >::Plane3D ( )
inline

default constructor create plane z = 0

Definition at line 64 of file Plane3D.h.

◆ Plane3D() [2/7]

template<typename T = double>
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const Scalar a,
const Scalar b,
const Scalar c,
const Scalar d 
)
inline

generic constructors from the four scalar values describing the plane according to the equation ax + by + cz + d = 0

Parameters
ascalar value
bscalar value
cscalar value
dsxcalar value

Definition at line 74 of file Plane3D.h.

◆ Plane3D() [3/7]

template<typename T = double>
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const Vector n,
const Point p 
)
inline

constructor a Plane3D from a normal vector and a point coplanar to the plane

Parameters
nnormal expressed as a ROOT::Math::DisplacementVector3D<Cartesian3D<T> >
ppoint expressed as a ROOT::Math::PositionVector3D<Cartesian3D<T> >

Definition at line 85 of file Plane3D.h.

◆ Plane3D() [4/7]

template<typename T = double>
template<class T1 , class T2 , class U >
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const DisplacementVector3D< T1, U > &  n,
const PositionVector3D< T2, U > &  p 
)
inline

Construct from a generic DisplacementVector3D (normal vector) and PositionVector3D (point coplanar to the plane)

Parameters
nnormal expressed as a generic ROOT::Math::DisplacementVector3D
ppoint expressed as a generic ROOT::Math::PositionVector3D

Definition at line 94 of file Plane3D.h.

◆ Plane3D() [5/7]

template<typename T = double>
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const Point p1,
const Point p2,
const Point p3 
)
inline

constructor from three Cartesian point belonging to the plane

Parameters
p1point1 expressed as a generic ROOT::Math::PositionVector3D
p2point2 expressed as a generic ROOT::Math::PositionVector3D
p3point3 expressed as a generic ROOT::Math::PositionVector3D

Definition at line 105 of file Plane3D.h.

◆ Plane3D() [6/7]

template<typename T = double>
template<class T1 , class T2 , class T3 , class U >
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const PositionVector3D< T1, U > &  p1,
const PositionVector3D< T2, U > &  p2,
const PositionVector3D< T3, U > &  p3 
)
inline

constructor from three generic point belonging to the plane

Parameters
p1point1 expressed as ROOT::Math::DisplacementVector3D<Cartesian3D<T> >
p2point2 expressed as ROOT::Math::DisplacementVector3D<Cartesian3D<T> >
p3point3 expressed as ROOT::Math::DisplacementVector3D<Cartesian3D<T> >

Definition at line 114 of file Plane3D.h.

◆ Plane3D() [7/7]

template<typename T = double>
ROOT::Math::Impl::Plane3D< T >::Plane3D ( const Plane3D< T > &  )
default

Member Function Documentation

◆ A()

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::A ( ) const
inline

Return the a coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).

It is also the x-component of the vector perpendicular to the plane.

Definition at line 133 of file Plane3D.h.

◆ B()

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::B ( ) const
inline

Return the b coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).

It is also the y-component of the vector perpendicular to the plane

Definition at line 139 of file Plane3D.h.

◆ BuildFrom3Points()

template<typename T = double>
void ROOT::Math::Impl::Plane3D< T >::BuildFrom3Points ( const Point p1,
const Point p2,
const Point p3 
)
inlineprivate

Definition at line 267 of file Plane3D.h.

◆ BuildFromVecAndPoint()

template<typename T = double>
void ROOT::Math::Impl::Plane3D< T >::BuildFromVecAndPoint ( const Vector n,
const Point p 
)
inlineprivate

Definition at line 256 of file Plane3D.h.

◆ C()

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::C ( ) const
inline

Return the c coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).

It is also the z-component of the vector perpendicular to the plane

Definition at line 145 of file Plane3D.h.

◆ D()

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::D ( ) const
inline

Return the d coefficient of the plane equation \( a*x + b*y + c*z + d = 0 \).

It is also the distance from the origin (HesseDistance)

Definition at line 151 of file Plane3D.h.

◆ Distance() [1/2]

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::Distance ( const Point p) const
inline

Return the signed distance to a Point.

The distance is signed positive if the Point is in the same side of the normal vector to the plane.

Parameters
pPoint expressed in Cartesian Coordinates

Definition at line 170 of file Plane3D.h.

◆ Distance() [2/2]

template<typename T = double>
template<class T1 , class U >
Scalar ROOT::Math::Impl::Plane3D< T >::Distance ( const PositionVector3D< T1, U > &  p) const
inline

Return the distance to a Point described with generic coordinates.

Parameters
pPoint expressed as generic ROOT::Math::PositionVector3D

Definition at line 177 of file Plane3D.h.

◆ HesseDistance()

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::HesseDistance ( ) const
inline

Return the Hesse Distance (distance from the origin) of the plane or the d coefficient expressed in normalize form.

Definition at line 162 of file Plane3D.h.

◆ Normal()

template<typename T = double>
Vector ROOT::Math::Impl::Plane3D< T >::Normal ( ) const
inline

Return normal vector to the plane as Cartesian DisplacementVector.

Definition at line 156 of file Plane3D.h.

◆ Normalize() [1/2]

template<typename T = double>
template<typename SCALAR = T, typename std::enable_if< std::is_arithmetic< SCALAR >::value >::type * = nullptr>
void ROOT::Math::Impl::Plane3D< T >::Normalize ( )
inlineprotected

Normalize the normal (a,b,c) plane components.

Definition at line 216 of file Plane3D.h.

◆ Normalize() [2/2]

template<typename T = double>
template<typename SCALAR = T, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr>
void ROOT::Math::Impl::Plane3D< T >::Normalize ( )
inlineprotected

Normalize the normal (a,b,c) plane components.

Definition at line 237 of file Plane3D.h.

◆ operator!=()

template<typename T = double>
bool ROOT::Math::Impl::Plane3D< T >::operator!= ( const Plane3D< T > &  rhs) const
inline

Definition at line 209 of file Plane3D.h.

◆ operator=()

template<typename T = double>
Plane3D & ROOT::Math::Impl::Plane3D< T >::operator= ( const Plane3D< T > &  )
default

Assignment operator from other Plane3D class.

◆ operator==()

template<typename T = double>
bool ROOT::Math::Impl::Plane3D< T >::operator== ( const Plane3D< T > &  rhs) const
inline

Exact equality.

Definition at line 208 of file Plane3D.h.

◆ ProjectOntoPlane() [1/2]

template<typename T = double>
Point ROOT::Math::Impl::Plane3D< T >::ProjectOntoPlane ( const Point p) const
inline

Return the projection of a Cartesian point to a plane.

Parameters
pPoint expressed as PositionVector3D<Cartesian3D<T> >

Definition at line 186 of file Plane3D.h.

◆ ProjectOntoPlane() [2/2]

template<typename T = double>
template<class T1 , class U >
PositionVector3D< T1, U > ROOT::Math::Impl::Plane3D< T >::ProjectOntoPlane ( const PositionVector3D< T1, U > &  p) const
inline

Return the projection of a point to a plane.

Parameters
pPoint expressed as generic ROOT::Math::PositionVector3D

Definition at line 197 of file Plane3D.h.

Member Data Documentation

◆ fA

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::fA
private

Definition at line 282 of file Plane3D.h.

◆ fB

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::fB
private

Definition at line 283 of file Plane3D.h.

◆ fC

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::fC
private

Definition at line 284 of file Plane3D.h.

◆ fD

template<typename T = double>
Scalar ROOT::Math::Impl::Plane3D< T >::fD
private

Definition at line 285 of file Plane3D.h.

  • math/genvector/inc/Math/GenVector/Plane3D.h