Jpp - the software that should make you happy
 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< JFirst_t, JSecond_t > 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...
 
JFirst_t & mul (const JSecond_t &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 35 of file JEulerAngle3D.hh.

Constructor & Destructor Documentation

JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( )
inline

Default constructor.

Definition at line 42 of file JEulerAngle3D.hh.

42  :
43  __alpha(0.0),
44  __beta (0.0),
45  __gamma(0.0)
46  {}
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 56 of file JEulerAngle3D.hh.

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

Constructor.

Parameters
angleangle

Definition at line 70 of file JEulerAngle3D.hh.

70  :
71  __alpha(PI/2),
72  __beta (angle.getTheta()),
73  __gamma(angle.getPhi() + PI/2)
74  {}
double getPhi() const
Get phi angle.
Definition: JAngle3D.hh:97
double getTheta() const
Get theta angle.
Definition: JAngle3D.hh:86
static const double PI
Mathematical constants.
JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( const JVersor3D versor)
inline

Constructor.

Parameters
versorversor

Definition at line 82 of file JEulerAngle3D.hh.

82  :
83  __alpha(PI/2),
84  __beta (versor.getTheta()),
85  __gamma(versor.getPhi() + PI/2)
86  {}
double getPhi() const
Get phi angle.
Definition: JVersor3D.hh:144
double getTheta() const
Get theta angle.
Definition: JVersor3D.hh:128
static const double PI
Mathematical constants.

Member Function Documentation

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

Get Euler angle.

Returns
this angle

Definition at line 94 of file JEulerAngle3D.hh.

95  {
96  return static_cast<const JEulerAngle3D&>(*this);
97  }
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 105 of file JEulerAngle3D.hh.

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

Negate angle.

Returns
this angle

Definition at line 116 of file JEulerAngle3D.hh.

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

Add angle.

Parameters
angleangle
Returns
this angle

Definition at line 132 of file JEulerAngle3D.hh.

133  {
134  __alpha += angle.getAlpha();
135  __beta += angle.getBeta();
136  __gamma += angle.getGamma();
137 
138  return *this;
139  }
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 148 of file JEulerAngle3D.hh.

149  {
150  __alpha -= angle.getAlpha();
151  __beta -= angle.getBeta();
152  __gamma -= angle.getGamma();
153 
154  return *this;
155  }
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 164 of file JEulerAngle3D.hh.

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

Scale angle.

Parameters
factordivision factor
Returns
this angle

Definition at line 180 of file JEulerAngle3D.hh.

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

Get alpha angle.

Returns
alpha angle

Definition at line 195 of file JEulerAngle3D.hh.

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

Get beta angle.

Returns
beta angle

Definition at line 206 of file JEulerAngle3D.hh.

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

Get gamma angle.

Returns
gamma angle

Definition at line 217 of file JEulerAngle3D.hh.

218  {
219  return __gamma;
220  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
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 230 of file JEulerAngle3D.hh.

231  {
232  in >> angle.__alpha >> angle.__beta >> angle.__gamma;
233 
234  return in;
235  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38
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 245 of file JEulerAngle3D.hh.

246  {
247  out << angle.getAlpha() << ' ' << angle.getBeta() << ' ' << angle.getGamma();
248 
249  return out;
250  }
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 260 of file JEulerAngle3D.hh.

261  {
262  in >> angle.__alpha;
263  in >> angle.__beta;
264  in >> angle.__gamma;
265 
266  return in;
267  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38
JWriter& operator<< ( JWriter out,
const JEulerAngle3D angle 
)
friend

Write Euler angles to output.

Parameters
outwriter
angleEuler angles
Returns
writer

Definition at line 277 of file JEulerAngle3D.hh.

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

Member Data Documentation

double JGEOMETRY3D::JEulerAngle3D::__alpha
protected

Definition at line 288 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__beta
protected

Definition at line 289 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__gamma
protected

Definition at line 290 of file JEulerAngle3D.hh.


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