Jpp  18.3.0-rc.1
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 36 of file JEulerAngle3D.hh.

Constructor & Destructor Documentation

JGEOMETRY3D::JEulerAngle3D::JEulerAngle3D ( )
inline

Default constructor.

Definition at line 43 of file JEulerAngle3D.hh.

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

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

Constructor.

Parameters
angleangle

Definition at line 71 of file JEulerAngle3D.hh.

71  :
72  __alpha(PI/2),
73  __beta (angle.getTheta()),
74  __gamma(angle.getPhi() + PI/2)
75  {}
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 83 of file JEulerAngle3D.hh.

83  :
84  __alpha(PI/2),
85  __beta (versor.getTheta()),
86  __gamma(versor.getPhi() + PI/2)
87  {}
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 95 of file JEulerAngle3D.hh.

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

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

Negate angle.

Returns
this angle

Definition at line 117 of file JEulerAngle3D.hh.

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

Add angle.

Parameters
angleangle
Returns
this angle

Definition at line 133 of file JEulerAngle3D.hh.

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

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

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

Scale angle.

Parameters
factordivision factor
Returns
this angle

Definition at line 181 of file JEulerAngle3D.hh.

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

Get alpha angle.

Returns
alpha angle

Definition at line 196 of file JEulerAngle3D.hh.

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

Get beta angle.

Returns
beta angle

Definition at line 207 of file JEulerAngle3D.hh.

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

Get gamma angle.

Returns
gamma angle

Definition at line 218 of file JEulerAngle3D.hh.

219  {
220  return __gamma;
221  }
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 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }

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 231 of file JEulerAngle3D.hh.

232  {
233  in >> angle.__alpha >> angle.__beta >> angle.__gamma;
234 
235  return in;
236  }
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
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 246 of file JEulerAngle3D.hh.

247  {
248  const JFormat format(out, getFormat<JAngle3D>(JFormat_t(9, 5, std::ios::fixed | std::ios::showpos)));
249 
250  out << format << angle.getAlpha() << ' '
251  << format << angle.getBeta() << ' '
252  << format << angle.getGamma();
253 
254  return out;
255  }
double getGamma() const
Get gamma angle.
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:634
double getAlpha() const
Get alpha angle.
double getBeta() const
Get beta angle.
Data structure for format specifications.
Definition: JManip.hh:524
JReader& operator>> ( JReader in,
JEulerAngle3D angle 
)
friend

Read Euler angles from input.

Parameters
inreader
angleEuler angles
Returns
reader

Definition at line 265 of file JEulerAngle3D.hh.

266  {
267  in >> angle.__alpha;
268  in >> angle.__beta;
269  in >> angle.__gamma;
270 
271  return in;
272  }
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
JWriter& operator<< ( JWriter out,
const JEulerAngle3D angle 
)
friend

Write Euler angles to output.

Parameters
outwriter
angleEuler angles
Returns
writer

Definition at line 282 of file JEulerAngle3D.hh.

283  {
284  out << angle.__alpha;
285  out << angle.__beta;
286  out << angle.__gamma;
287 
288  return out;
289  }

Member Data Documentation

double JGEOMETRY3D::JEulerAngle3D::__alpha
protected

Definition at line 293 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__beta
protected

Definition at line 294 of file JEulerAngle3D.hh.

double JGEOMETRY3D::JEulerAngle3D::__gamma
protected

Definition at line 295 of file JEulerAngle3D.hh.


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