Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JGEOMETRY3D::JEulerAngle3D Class Reference

Data structure for Euler angles in three dimensions. More...

#include <JEulerAngle3D.hh>

Inheritance diagram for JGEOMETRY3D::JEulerAngle3D:
JMATH::JMath< JEulerAngle3D > JDETECTOR::JModuleGeometry

Public Member Functions

 JEulerAngle3D ()
 Default constructor. More...
 
 JEulerAngle3D (const double alpha, const double beta, const double gamma)
 Constructor. More...
 
 JEulerAngle3D (const JAngle3D &angle)
 Constructor. More...
 
 JEulerAngle3D (const JVersor3D &versor)
 Constructor. More...
 
const JEulerAngle3DgetEulerAngle () const
 Get Euler angle. More...
 
void setEulerAngle (const JEulerAngle3D &angle)
 Set Euler angle. More...
 
JEulerAngle3Dnegate ()
 Negate angle. More...
 
JEulerAngle3Dadd (const JEulerAngle3D &angle)
 Add angle. More...
 
JEulerAngle3Dsub (const JEulerAngle3D &angle)
 Subtract angle. More...
 
JEulerAngle3Dmul (const double factor)
 Scale angle. More...
 
JEulerAngle3Ddiv (const double factor)
 Scale angle. More...
 
double getAlpha () const
 Get alpha angle. More...
 
double getBeta () const
 Get beta angle. More...
 
double getGamma () const
 Get gamma angle. More...
 
JEulerAngle3Dmul (const JNullType &object)
 Multiply with object. More...
 

Protected Attributes

double __alpha
 
double __beta
 
double __gamma
 

Friends

std::istream & operator>> (std::istream &in, JEulerAngle3D &angle)
 Read Euler angles from input. More...
 
std::ostream & operator<< (std::ostream &out, const JEulerAngle3D &angle)
 Write Euler angles to output. More...
 
JReaderoperator>> (JReader &in, JEulerAngle3D &angle)
 Read Euler angles from input. More...
 
JWriteroperator<< (JWriter &out, const JEulerAngle3D &angle)
 Write Euler angles to output. More...
 

Detailed Description

Data structure for Euler angles in three dimensions.

This class implements the JMATH::JMath interface.

Definition at line 34 of file JEulerAngle3D.hh.

Constructor & Destructor Documentation

JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( )
inline

Default constructor.

Definition at line 41 of file JEulerAngle3D.hh.

41  :
42  __alpha(0.0),
43  __beta (0.0),
44  __gamma(0.0)
45  {}
JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( const double  alpha,
const double  beta,
const double  gamma 
)
inline

Constructor.

Parameters
alphaalpha angle [rad]
betabeta angle [rad]
gammagamma angle [rad]

Definition at line 55 of file JEulerAngle3D.hh.

57  :
58  __alpha(alpha),
59  __beta (beta),
60  __gamma(gamma)
61  {}
JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( const JAngle3D angle)
inline

Constructor.

Parameters
angleangle

Definition at line 69 of file JEulerAngle3D.hh.

69  :
70  __alpha(PI/2),
71  __beta (angle.getTheta()),
72  __gamma(angle.getPhi() + PI/2)
73  {}
double getPhi() const
Get phi angle.
Definition: JAngle3D.hh:95
static const double PI
Constants.
Definition: JConstants.hh:20
double getTheta() const
Get theta angle.
Definition: JAngle3D.hh:84
JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( const JVersor3D versor)
inline

Constructor.

Parameters
versorversor

Definition at line 81 of file JEulerAngle3D.hh.

81  :
82  __alpha(PI/2),
83  __beta (versor.getTheta()),
84  __gamma(versor.getPhi() + PI/2)
85  {}
static const double PI
Constants.
Definition: JConstants.hh:20
double getPhi() const
Get phi angle.
Definition: JVersor3D.hh:141
double getTheta() const
Get theta angle.
Definition: JVersor3D.hh:125

Member Function Documentation

const JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::getEulerAngle ( ) const
inline

Get Euler angle.

Returns
this angle

Definition at line 93 of file JEulerAngle3D.hh.

94  {
95  return static_cast<const JEulerAngle3D&>(*this);
96  }
Data structure for Euler angles in three dimensions.
void JGEOMETRY3D::JEulerAngle3D::setEulerAngle ( const JEulerAngle3D angle)
inline

Set Euler angle.

Parameters
angleEuler angle

Definition at line 104 of file JEulerAngle3D.hh.

105  {
106  static_cast<JEulerAngle3D&>(*this) = angle;
107  }
Data structure for Euler angles in three dimensions.
JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::negate ( )
inline

Negate angle.

Returns
this angle

Definition at line 115 of file JEulerAngle3D.hh.

116  {
117  __alpha = -__alpha;
118  __beta = -__beta;
119  __gamma = -__gamma;
120 
121  return *this;
122  }
JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::add ( const JEulerAngle3D angle)
inline

Add angle.

Parameters
angleangle
Returns
this angle

Definition at line 131 of file JEulerAngle3D.hh.

132  {
133  __alpha += angle.getAlpha();
134  __beta += angle.getBeta();
135  __gamma += angle.getGamma();
136 
137  return *this;
138  }
double getGamma() const
Get gamma angle.
double getAlpha() const
Get alpha angle.
double getBeta() const
Get beta angle.
JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::sub ( const JEulerAngle3D angle)
inline

Subtract angle.

Parameters
angleangle
Returns
this angle

Definition at line 147 of file JEulerAngle3D.hh.

148  {
149  __alpha -= angle.getAlpha();
150  __beta -= angle.getBeta();
151  __gamma -= angle.getGamma();
152 
153  return *this;
154  }
double getGamma() const
Get gamma angle.
double getAlpha() const
Get alpha angle.
double getBeta() const
Get beta angle.
JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::mul ( const double  factor)
inline

Scale angle.

Parameters
factormultiplication factor
Returns
this angle

Definition at line 163 of file JEulerAngle3D.hh.

164  {
165  __alpha *= factor;
166  __beta *= factor;
167  __gamma *= factor;
168 
169  return *this;
170  }
JEulerAngle3D& JGEOMETRY3D::JEulerAngle3D::div ( const double  factor)
inline

Scale angle.

Parameters
factordivision factor
Returns
this angle

Definition at line 179 of file JEulerAngle3D.hh.

180  {
181  __alpha /= factor;
182  __beta /= factor;
183  __gamma /= factor;
184 
185  return *this;
186  }
double JGEOMETRY3D::JEulerAngle3D::getAlpha ( ) const
inline

Get alpha angle.

Returns
alpha angle

Definition at line 194 of file JEulerAngle3D.hh.

195  {
196  return __alpha;
197  }
double JGEOMETRY3D::JEulerAngle3D::getBeta ( ) const
inline

Get beta angle.

Returns
beta angle

Definition at line 205 of file JEulerAngle3D.hh.

206  {
207  return __beta;
208  }
double JGEOMETRY3D::JEulerAngle3D::getGamma ( ) const
inline

Get gamma angle.

Returns
gamma angle

Definition at line 216 of file JEulerAngle3D.hh.

217  {
218  return __gamma;
219  }
JEulerAngle3D & JMATH::JMath< JEulerAngle3D , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JEulerAngle3D angle 
)
friend

Read Euler angles from input.

Parameters
ininput stream
angleEuler angles
Returns
input stream

Definition at line 229 of file JEulerAngle3D.hh.

230  {
231  in >> angle.__alpha >> angle.__beta >> angle.__gamma;
232 
233  return in;
234  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
std::ostream& operator<< ( std::ostream &  out,
const JEulerAngle3D angle 
)
friend

Write Euler angles to output.

Parameters
outoutput stream
angleEuler angle
Returns
output stream

Definition at line 244 of file JEulerAngle3D.hh.

245  {
246  out << angle.getAlpha() << ' ' << angle.getBeta() << ' ' << angle.getGamma();
247 
248  return out;
249  }
double getGamma() const
Get gamma angle.
double getAlpha() const
Get alpha angle.
double getBeta() const
Get beta angle.
JReader& operator>> ( JReader in,
JEulerAngle3D angle 
)
friend

Read Euler angles from input.

Parameters
inreader
angleEuler angles
Returns
reader

Definition at line 259 of file JEulerAngle3D.hh.

260  {
261  in >> angle.__alpha;
262  in >> angle.__beta;
263  in >> angle.__gamma;
264 
265  return in;
266  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
JWriter& operator<< ( JWriter out,
const JEulerAngle3D angle 
)
friend

Write Euler angles to output.

Parameters
outwriter
angleEuler angles
Returns
writer

Definition at line 276 of file JEulerAngle3D.hh.

277  {
278  out << angle.__alpha;
279  out << angle.__beta;
280  out << angle.__gamma;
281 
282  return out;
283  }

Member Data Documentation

double JGEOMETRY3D::JEulerAngle3D::__alpha
protected

Definition at line 287 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__beta
protected

Definition at line 288 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__gamma
protected

Definition at line 289 of file JEulerAngle3D.hh.


The documentation for this class was generated from the following file: