Problem 985 - G4AffineTransform::Inverse() calculates translation incorrectly?
Summary: G4AffineTransform::Inverse() calculates translation incorrectly?
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/management (show other problems)
Version: 8.0
Hardware: Apple Mac OS X
: P5 minor
Assignee: Vladimir.Grichine
URL:
Depends on:
Blocks:
 
Reported: 2007-11-13 18:19 CET by Steve Malton
Modified: 2007-11-13 20:47 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Steve Malton 2007-11-13 18:19:32 CET
The function calculates the inverse via:

inline
G4AffineTransform G4AffineTransform::Inverse() const
{
        return G4AffineTransform( rxx, ryx, rzx,
                                  rxy, ryy, rzy, // (Rot)^-1
                                  rxz, ryz, rzz,

                                 -tx*rxx - ty*rxy - tz*rxz,
                                 -tx*ryx - ty*ryy - tz*ryz,  (Rot)(-t)?
                                 -tx*rzx - ty*rzy - tz*rzz  );
}

In this case the translation applied is (Rot)(-t) rather than (Rot)^-1(-t) as I would expect. That is, the inverse translation is rotated again by the initial rotation, rather than by the inverse rotation.

The same appears to be true of ::Invert()
Comment 1 Gabriele Cosmo 2007-11-13 19:05:32 CET
I believe that G4AffineTransform implementations of Inverse()/Invert() follow the original
specifications for this class which is for -internal- use only in Geant4 (therefore not to
be used outside the Geant4 framework).
Assigning to the responsible for double-check.
Comment 2 Steve Malton 2007-11-13 20:47:46 CET
Apologies, I had thought that the transform was built by (translate)(rotate). The implementation is correct for (rotate)(translate) transform.