| Summary: | G4AffineTransform::Inverse() calculates translation incorrectly? | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Steve Malton <malton> |
| Component: | geometry/management | Assignee: | Vladimir.Grichine |
| Status: | RESOLVED INVALID | ||
| Severity: | minor | CC: | Gabriele.Cosmo |
| Priority: | P5 | ||
| Version: | 8.0 | ||
| Hardware: | Apple | ||
| OS: | Mac OS X | ||
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. Apologies, I had thought that the transform was built by (translate)(rotate). The implementation is correct for (rotate)(translate) transform. |
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()