Skip to content

Commit

Permalink
Fix #112: clockwise rotation around y axis
Browse files Browse the repository at this point in the history
  • Loading branch information
ftessier authored Aug 17, 2016
1 parent 39a60f8 commit 0cf6670
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HEN_HOUSE/egs++/egs_transformations.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ class EGS_EXPORT EGS_RotationMatrix {
with \a cphi, \a sphi = \f$ \cos(\phi), \sin(\phi)\f$.
*/
static EGS_RotationMatrix rotY(EGS_Float cphi,EGS_Float sphi) {
return EGS_RotationMatrix(cphi, (EGS_Float)0, sphi,
return EGS_RotationMatrix(cphi, (EGS_Float)0, -sphi,
(EGS_Float)0, (EGS_Float)1, (EGS_Float)0,
-sphi, (EGS_Float)0, cphi);
sphi, (EGS_Float)0, cphi);
};

/*! \brief Returns a rotation around the z-axis by the angle \f$\phi\f$
Expand Down

1 comment on commit 0cf6670

@rtownson
Copy link
Collaborator

@rtownson rtownson commented on 0cf6670 Jan 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just like to highlight this commit - for consistency between EGSnrc 2016 and EGSnrc 2017++, the user must update any egs++ input file that uses the transformation input block with a rotation! This is because the direction of rotation about the y-axis has reversed.

For example, if your input file for EGSnrc 2016 contained:

:start transformation:
  translation = 0 0 45
  rotation = 0.5 0.5 0.5
:stop transformation:

For the output to be the same after this commit it must be updated to:

:start transformation:
  translation = 0 0 45
  rotation = 0.5 -0.5 0.5
:stop transformation:

Note that this commit fixes an inconsistency in the rotation direction, so now it is correct. However, this poses a problem for old input files that were designed with the inconsistency in place. Make sure to validate rotation transformations if you are using EGSnrc 2017 or later with an older input file.

Please sign in to comment.