Message: Re: Direction of rotation - clockwise or counterclockwise Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Direction of rotation - clockwise or counterclockwise 

Forum: Geometry
Re: Warning Direction of rotation - clockwise or counterclockwise (Patrik Eschle)
Re: None Re: Direction of rotation - clockwise or counterclockwise (michel maire)
Date: 02 Apr, 2015
From: Patrik Eschle <Patrik Eschle>

Hello

Now the confusion is complete. Two seemingly equivalent methods rotate in different sense.

Historical background: We noticed that G4PVPlacement(rotMat, tlate, ..) rotates according to the left hand around an axis. A positive angle results in a counterclockwise (ccw) rotation around the axis.

Michael Kelsey commented "There are two different conventions, and Transform3D uses the opposite one to ThreeVector::rotate()". - Ok, fine with me: "use minus where you want plus".

But then Michel Maire points me to examples/extended/geometry/transforms. I reduced the method PlaceWithAxialRotations() to the bare minimum. The same logical volume is placed at x=+2cm and x=-2cm. Once rotated with G4Transform3D and once by directly giving the rotation matrix and translation.

 void DetectorConstruction::PlaceWithAxialRotations()
 {
  G4RotationMatrix *rm = new G4RotationMatrix();
  rm->rotateZ(30*deg);

  G4ThreeVector shiftX = G4ThreeVector(1,0,0)*2*cm;

  G4Transform3D transform1(*rm,shiftX);
  new G4PVPlacement(transform1, // Rotates clockwise, right hand - ok
                    fTrdVolume,"Trd", fWorldVolume, false,1);
  new G4PVPlacement(rm,-shiftX, // Rotates ccw - confusing
                    fTrdVolume,"Trd", fWorldVolume, false,1);
 }

The first placement with Transform3D at +x rotates correctly clockwise. The second placement with (rm, tlate,..) at -x rotates confusingly ccw.

The naive user I am I consider both placements as equivalent, but they are not. Is it just me that's irritated by that or does everybody else understand the difference?

Patrik

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/04/02/05.54-54824-s_DetectorContruction.png

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Direction of rotation - clockwise or counterclockwise   (John Allison - 02 Apr, 2015)
2 None: Re: Direction of rotation - clockwise or counterclockwise   (michel maire - 04 Apr, 2015)
1 None: Re: Direction of rotation - clockwise or counterclockwise   (michel maire - 05 Apr, 2015)
 Add Message Add Message
to: "Re: Direction of rotation - clockwise or counterclockwise"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]