DifRotation Class Reference

#include <DifRotation.h>

List of all members.

Public Member Functions

 DifRotation ()
 DifRotation (const DifNumber &alpha, const DifNumber &beta, const DifNumber &gamma)
 DifRotation (const DifVector &xp, const DifVector &yp, const DifVector &zp)
 DifRotation (const DifVector &xp, const DifVector &yp)
 ~DifRotation ()
DifVector xnew () const
DifVector ynew () const
DifVector znew () const
void rotate (DifVector &v) const
int fail () const

Private Attributes

DifVector _xnew
DifVector _ynew
DifVector _znew


Detailed Description

Definition at line 28 of file DifRotation.h.


Constructor & Destructor Documentation

DifRotation::DifRotation (  ) 

Definition at line 25 of file DifRotation.cxx.

00026   :_xnew(1.0,0.0,0.0),_ynew(0.0,1.0,0.0),_znew(0.0,0.0,1.0)
00027 {
00028 }

DifRotation::DifRotation ( const DifNumber alpha,
const DifNumber beta,
const DifNumber gamma 
)

Definition at line 31 of file DifRotation.cxx.

References alpha, cos(), and sin().

00032 {
00033   
00034   //active transformation  - move the vector (reverse sines)
00035   DifNumber calpha=cos(alpha); DifNumber salpha=-sin(alpha);
00036   DifNumber cbeta=cos(beta); DifNumber sbeta=-sin(beta);
00037   DifNumber cgamma=cos(gamma); DifNumber sgamma=-sin(gamma);
00038 
00039  _xnew.x=cbeta*calpha*cgamma-salpha*sgamma;
00040  _xnew.y=cbeta*salpha*cgamma+calpha*sgamma;
00041  _xnew.z=-sbeta*cgamma;
00042 
00043  _ynew.x=-cbeta*calpha*sgamma-salpha*cgamma;
00044  _ynew.y=-cbeta*salpha*sgamma+calpha*cgamma;
00045  _ynew.z=sbeta*sgamma;
00046 
00047  _znew.x=sbeta*calpha;
00048  _znew.y=sbeta*salpha;
00049  _znew.z=cbeta;
00050 }

DifRotation::DifRotation ( const DifVector xp,
const DifVector yp,
const DifVector zp 
)

Definition at line 53 of file DifRotation.cxx.

00054   :_xnew(xp),_ynew(yp),_znew(zp)
00055 {}                              

DifRotation::DifRotation ( const DifVector xp,
const DifVector yp 
)

Definition at line 58 of file DifRotation.cxx.

References cross().

00059   :_xnew(xp),_ynew(yp),_znew()
00060 {
00061   _znew=cross(_xnew,_ynew);
00062 }

DifRotation::~DifRotation (  )  [inline]

Definition at line 44 of file DifRotation.h.

00044 {};


Member Function Documentation

int DifRotation::fail (  )  const

Definition at line 64 of file DifRotation.cxx.

00064                            {
00065   return 0;
00066 }

void DifRotation::rotate ( DifVector v  )  const

Definition at line 68 of file DifRotation.cxx.

References v, xnew(), ynew(), and znew().

00068                                           {
00069   DifNumber xcomp=xnew()*v;
00070   DifNumber ycomp=ynew()*v;
00071   DifNumber zcomp=znew()*v;
00072   v.x=xcomp; v.y=ycomp; v.z=zcomp;
00073 }

DifVector DifRotation::xnew (  )  const [inline]

Definition at line 47 of file DifRotation.h.

References _xnew.

Referenced by rotate().

00047 {return _xnew;}

DifVector DifRotation::ynew (  )  const [inline]

Definition at line 48 of file DifRotation.h.

References _ynew.

Referenced by rotate().

00048 {return _ynew;}

DifVector DifRotation::znew (  )  const [inline]

Definition at line 49 of file DifRotation.h.

References _znew.

Referenced by rotate().

00049 {return _znew;}


Member Data Documentation

DifVector DifRotation::_xnew [private]

Definition at line 60 of file DifRotation.h.

Referenced by xnew().

DifVector DifRotation::_ynew [private]

Definition at line 61 of file DifRotation.h.

Referenced by ynew().

DifVector DifRotation::_znew [private]

Definition at line 62 of file DifRotation.h.

Referenced by znew().


Generated on Tue Nov 29 23:18:16 2016 for BOSS_7.0.2 by  doxygen 1.4.7