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

Warning Direction of rotation - clockwise or counterclockwise 

Forum: Geometry
Date: 01 Apr, 2015
From: Patrik Eschle <Patrik Eschle>

Hello

This is just a matter of signs - but it is confusing and (IMHO) undocumented.

While working with TOPAS (http://topasmc.org/) I wondered about their way of rotating objects. A positive angle results in a counterclockwise rotation around the given axis.

I checked with Geant by rotating a vector:

v=G4ThreeVector(0,1,0); v.rotateZ(45*deg);

This rotates the vector correctly clockwise around the Z axis, which is the usual convention in physics (a.k.a "right hand rule").

But then we noticed that objects placed with G4PVPlacement are actually rotated the other way round. Passing a rotation matrix rm->rotX(30) to G4PVPlacement(rm, ...) will rotate the placed object counterclockwise.

Deep inside CLHEP in Transform3D.cc a comment says:

Rotate3D::Rotate3D(double a,
		     const Point3D<double> & p1,
		     const Point3D<double> & p2) : Transform3D()
  /***********************************************************************
   *                                                                     *
   * Name: Rotate3D::Rotate3D                       Date:    24.09.96 *
   * Author: E.Chernyaev (IHEP/Protvino)               Revised:          *
   *                                                                     *
   * Function: Create 3D Rotation through angle "a" (counterclockwise)   *
   *           around the axis p1->p2                                    *
   *                                                                     *
   ***********************************************************************/$

This seems to be the source of all evil! Is there any reason why this convention was chosen?

  Patrik

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   (Michael H. Kelsey - 01 Apr, 2015)
2 None: Re: Direction of rotation - clockwise or counterclockwise   (michel maire - 02 Apr, 2015)
1 None: Re: Direction of rotation - clockwise or counterclockwise   (Patrik Eschle - 02 Apr, 2015)
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 Message(s)
 Add Message Add Message
to: "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 ]