Data structure for angles in three dimensions.  
 More...
#include <JAngle3D.hh>
 | 
|   | JAngle3D () | 
|   | Default constructor.  
  | 
|   | 
|   | JAngle3D (const double theta, const double phi) | 
|   | Constructor.  
  | 
|   | 
|   | JAngle3D (const double x, const double y, const double z) | 
|   | Constructor.  
  | 
|   | 
| double  | getTheta () const | 
|   | Get theta angle.  
  | 
|   | 
| double  | getPhi () const | 
|   | Get phi angle.  
  | 
|   | 
| double  | getDX () const | 
|   | Get x direction.  
  | 
|   | 
| double  | getDY () const | 
|   | Get y direction.  
  | 
|   | 
| double  | getDZ () const | 
|   | Get z direction.  
  | 
|   | 
| JAngle3D &  | negate () | 
|   | Negate angle.  
  | 
|   | 
| JAngle3D &  | add (const JAngle3D &angle) | 
|   | Add angle.  
  | 
|   | 
| JAngle3D &  | sub (const JAngle3D &angle) | 
|   | Subtract angle.  
  | 
|   | 
| JAngle3D &  | mul (const double factor) | 
|   | Scale angle.  
  | 
|   | 
| JAngle3D &  | div (const double factor) | 
|   | Scale angle.  
  | 
|   | 
| bool  | equals (const JAngle3D &angle, const double precision=std::numeric_limits< double >::min()) const | 
|   | Check equality.  
  | 
|   | 
| double  | getDot (const JAngle3D &angle) const | 
|   | Get dot product.  
  | 
|   | 
| JAngle3D &  | normalise () | 
|   | Normalise angles.  
  | 
|   | 
| JFirst_t &  | mul (const JSecond_t &object) | 
|   | Multiply with object.  
  | 
|   | 
Data structure for angles in three dimensions. 
This class serves as input to the rotation matrix JRotation3D. 
Definition at line 33 of file JAngle3D.hh.
 
◆ JAngle3D() [1/3]
  
  
      
        
          | JGEOMETRY3D::JAngle3D::JAngle3D  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JAngle3D() [2/3]
  
  
      
        
          | JGEOMETRY3D::JAngle3D::JAngle3D  | 
          ( | 
          const double |           theta,  | 
         
        
           | 
           | 
          const double |           phi ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | theta | theta angle [rad]  | 
    | phi | phi angle [rad]  | 
  
   
Definition at line 52 of file JAngle3D.hh.
 
 
◆ JAngle3D() [3/3]
  
  
      
        
          | JGEOMETRY3D::JAngle3D::JAngle3D  | 
          ( | 
          const double |           x,  | 
         
        
           | 
           | 
          const double |           y,  | 
         
        
           | 
           | 
          const double |           z ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | x | x value  | 
    | y | y value  | 
    | z | z value  | 
  
   
Definition at line 66 of file JAngle3D.hh.
   68                             :
   71    {
   72      const double v = 
x*
x + 
y*
y + z*z;
 
   73 
   74      if (v != 0.0) {      
   77      }
   78    }
 
 
 
◆ getTheta()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getTheta  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get theta angle. 
- Returns
 - theta angle 
 
Definition at line 86 of file JAngle3D.hh.
 
 
◆ getPhi()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getPhi  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get phi angle. 
- Returns
 - phi angle 
 
Definition at line 97 of file JAngle3D.hh.
 
 
◆ getDX()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getDX  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get x direction. 
- Returns
 - x direction 
 
Definition at line 108 of file JAngle3D.hh.
 
 
◆ getDY()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getDY  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get y direction. 
- Returns
 - y direction 
 
Definition at line 119 of file JAngle3D.hh.
 
 
◆ getDZ()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getDZ  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get z direction. 
- Returns
 - z direction 
 
Definition at line 130 of file JAngle3D.hh.
 
 
◆ negate()
  
  
      
        
          | JAngle3D & JGEOMETRY3D::JAngle3D::negate  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Negate angle. 
- Returns
 - this angle 
 
Definition at line 141 of file JAngle3D.hh.
  142    {
  145 
  146      return *this;
  147    }
 
 
 
◆ add()
Add angle. 
- Parameters
 - 
  
  
 
- Returns
 - this angle 
 
Definition at line 156 of file JAngle3D.hh.
  157    {
  159      __phi   += angle.getPhi();
 
  160 
  161      return *this;
  162    }
 
 
 
◆ sub()
Subtract angle. 
- Parameters
 - 
  
  
 
- Returns
 - this angle 
 
Definition at line 171 of file JAngle3D.hh.
  172    {
  174      __phi   -= angle.getPhi();
 
  175 
  176      return *this;
  177    }
 
 
 
◆ mul() [1/2]
  
  
      
        
          | JAngle3D & JGEOMETRY3D::JAngle3D::mul  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale angle. 
- Parameters
 - 
  
    | factor | multiplication factor  | 
  
   
- Returns
 - this angle 
 
Definition at line 185 of file JAngle3D.hh.
  186    {
  189 
  190      return *this;
  191    }
 
 
 
◆ div()
  
  
      
        
          | JAngle3D & JGEOMETRY3D::JAngle3D::div  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale angle. 
- Parameters
 - 
  
  
 
- Returns
 - this angle 
 
Definition at line 200 of file JAngle3D.hh.
  201    {
  204 
  205      return *this;
  206    }
 
 
 
◆ equals()
  
  
      
        
          | bool JGEOMETRY3D::JAngle3D::equals  | 
          ( | 
          const JAngle3D & |           angle,  | 
         
        
           | 
           | 
          const double |           precision = std::numeric_limits<double>::min() ) const | 
         
       
   | 
  
inline   | 
  
 
Check equality. 
- Parameters
 - 
  
    | angle | angle  | 
    | precision | precision  | 
  
   
- Returns
 - true if angles are equal; else false 
 
Definition at line 216 of file JAngle3D.hh.
  218    {
  219      return (fabs(
getTheta() - angle.getTheta()) <= precision &&
 
  220              fabs(
getPhi()   - angle.getPhi())   <= precision);
 
  221    }
double getTheta() const
Get theta angle.
 
double getPhi() const
Get phi angle.
 
 
 
 
◆ getDot()
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::getDot  | 
          ( | 
          const JAngle3D & |           angle | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get dot product. 
- Parameters
 - 
  
  
 
- Returns
 - dot product 
 
Definition at line 230 of file JAngle3D.hh.
  231    {
  232      return
  233        cos(
getTheta()) * cos(angle.getTheta()) +
 
  234        sin(
getTheta()) * sin(angle.getTheta()) *
 
  235        cos(
getPhi() - angle.getPhi());
 
  236    }
 
 
 
◆ normalise()
  
  
      
        
          | JAngle3D & JGEOMETRY3D::JAngle3D::normalise  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Normalise angles. 
- theta angle will be between 0 and π
 
- phi angle will be between -π and +π
 
- Returns
 - this angle 
 
Definition at line 247 of file JAngle3D.hh.
  248    {
  250 
  253 
  256 
  257      return *this;
  258    }
static const double PI
Mathematical constants.
 
 
 
 
◆ mul() [2/2]
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    }
 
 
 
◆ operator>> [1/2]
  
  
      
        
          | std::istream & operator>>  | 
          ( | 
          std::istream & |           in,  | 
         
        
           | 
           | 
          JAngle3D & |           angle ) | 
         
       
   | 
  
friend   | 
  
 
Write angle from input. 
- Parameters
 - 
  
    | in | input stream  | 
    | angle | angle  | 
  
   
- Returns
 - input stream 
 
Definition at line 268 of file JAngle3D.hh.
  269    {
  270      in >> angle.__theta >> angle.__phi;
  271 
  272      return in;
  273    }
 
 
 
◆ operator<< [1/2]
  
  
      
        
          | std::ostream & operator<<  | 
          ( | 
          std::ostream & |           out,  | 
         
        
           | 
           | 
          const JAngle3D & |           angle ) | 
         
       
   | 
  
friend   | 
  
 
Write angle to output. 
- Parameters
 - 
  
    | out | output stream  | 
    | angle | angle  | 
  
   
- Returns
 - output stream 
 
Definition at line 283 of file JAngle3D.hh.
  284    {
  286 
  287      out << format << angle.getTheta() << ' '
  288          << format << angle.getPhi();
  289 
  290      return out;
  291    }
JFormat_t & getFormat()
Get format for given type.
 
 
 
 
◆ operator>> [2/2]
Read angle from input. 
- Parameters
 - 
  
  
 
- Returns
 - reader 
 
Definition at line 301 of file JAngle3D.hh.
  302    {
  303      in >> angle.__theta;
  304      in >> angle.__phi;
  305 
  306      return in;
  307    }
 
 
 
◆ operator<< [2/2]
Write angle to output. 
- Parameters
 - 
  
  
 
- Returns
 - writer 
 
Definition at line 317 of file JAngle3D.hh.
  318    {
  319      out << angle.__theta;
  320      out << angle.__phi;
  321 
  322      return out;
  323    }
 
 
 
◆ __theta
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::__theta | 
         
       
   | 
  
protected   | 
  
 
 
◆ __phi
  
  
      
        
          | double JGEOMETRY3D::JAngle3D::__phi | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: