Data structure for normalised vector in three dimensions.  
 More...
#include <JVersor3D.hh>
Data structure for normalised vector in three dimensions. 
Definition at line 26 of file JVersor3D.hh.
 
◆ JVersor3D() [1/2]
  
  
      
        
          | JGEOMETRY3D::JVersor3D::JVersor3D  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
This constructor yields a unit z-vector. 
 
Definition at line 34 of file JVersor3D.hh.
 
 
◆ JVersor3D() [2/2]
  
  
      
        
          | JGEOMETRY3D::JVersor3D::JVersor3D  | 
          ( | 
          const double |           dx,  | 
         
        
           | 
           | 
          const double |           dy,  | 
         
        
           | 
           | 
          const double |           dz ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | dx | dx value  | 
    | dy | dy value  | 
    | dz | dz value  | 
  
   
Definition at line 48 of file JVersor3D.hh.
   50                               :
   54    {
   56    }
JVersor3D & normalise()
Normalise versor.
 
 
 
 
◆ negate()
  
  
      
        
          | JVersor3D & JGEOMETRY3D::JVersor3D::negate  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Negate versor. 
- Returns
 - this versor 
 
Definition at line 64 of file JVersor3D.hh.
   65    {
   69 
   70      return *this;
   71    }
 
 
 
◆ equals()
  
  
      
        
          | bool JGEOMETRY3D::JVersor3D::equals  | 
          ( | 
          const JVersor3D & |           versor,  | 
         
        
           | 
           | 
          const double |           precision = std::numeric_limits<double>::min() ) const | 
         
       
   | 
  
inline   | 
  
 
Check equality. 
- Parameters
 - 
  
    | versor | versor  | 
    | precision | precision  | 
  
   
- Returns
 - true if versors are equal; else false 
 
Definition at line 81 of file JVersor3D.hh.
   83    {
   84      return (fabs(
getDX() - versor.getDX()) <= precision &&
 
   85              fabs(
getDY() - versor.getDY()) <= precision &&
 
   86              fabs(
getDZ() - versor.getDZ()) <= precision);
 
   87    }
double getDY() const
Get y direction.
 
double getDX() const
Get x direction.
 
double getDZ() const
Get z direction.
 
 
 
 
◆ getDX()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getDX  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get x direction. 
- Returns
 - x direction 
 
Definition at line 95 of file JVersor3D.hh.
 
 
◆ getDY()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getDY  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get y direction. 
- Returns
 - y direction 
 
Definition at line 106 of file JVersor3D.hh.
 
 
◆ getDZ()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getDZ  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get z direction. 
- Returns
 - z direction 
 
Definition at line 117 of file JVersor3D.hh.
 
 
◆ getTheta()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getTheta  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get theta angle. 
- Returns
 - theta angle [rad] 
 
Definition at line 128 of file JVersor3D.hh.
  129    {
  131        return 0.0;
  132      else if (
__dz < -1.0)
 
  134      else
  136    }
static const double PI
Mathematical constants.
 
 
 
 
◆ getPhi()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getPhi  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get phi angle. 
- Returns
 - phi angle [rad] 
 
Definition at line 144 of file JVersor3D.hh.
 
 
◆ getDot()
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::getDot  | 
          ( | 
          const JVersor3D & |           versor | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get dot product. 
- Parameters
 - 
  
  
 
- Returns
 - dot product 
 
Definition at line 156 of file JVersor3D.hh.
  157    {
  158      return
  159        getDX() * versor.getDX() + 
 
  160        getDY() * versor.getDY() +
 
  161        getDZ() * versor.getDZ();
 
  162    }
 
 
 
◆ getCross()
Get cross product. 
Note that this versor should not overlap with the first or second versor,
- Parameters
 - 
  
    | first | first versor  | 
    | second | second versor  | 
  
   
- Returns
 - this versor 
 
Definition at line 173 of file JVersor3D.hh.
  175    {
  176      __dx = first .getDY() * second.getDZ()  -  second.getDY() * first .getDZ();
 
  177      __dy = second.getDX() * first .getDZ()  -  first .getDX() * second.getDZ();
 
  178      __dz = first .getDX() * second.getDY()  -  second.getDX() * first .getDY();
 
  179 
  181 
  182      return *this;
  183    }
 
 
 
◆ normalise()
  
  
      
        
          | JVersor3D & JGEOMETRY3D::JVersor3D::normalise  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Normalise versor. 
This operation may set the result to the unit z-vector.
- Returns
 - this versor 
 
Definition at line 192 of file JVersor3D.hh.
  193    {
  195 
  196      if (v != 0.0) {
  200      }
  201 
  202      return *this;
  203    }
 
 
 
◆ mul()
template<class JFirst_t , class JSecond_t > 
  
  
      
        
          | JFirst_t & JMATH::JMath< JFirst_t, JSecond_t >::mul  | 
          ( | 
          const JSecond_t & |           object | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Multiply with object. 
- Parameters
 - 
  
  
 
- Returns
 - result object 
 
Definition at line 354 of file JMath.hh.
  355    {
  356      return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
  357    }
 
 
 
◆ __dx
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::__dx | 
         
       
   | 
  
protected   | 
  
 
 
◆ __dy
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::__dy | 
         
       
   | 
  
protected   | 
  
 
 
◆ __dz
  
  
      
        
          | double JGEOMETRY3D::JVersor3D::__dz | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: