[Gate-users] source rotation

Marc Chamberland mchamber at connect.carleton.ca
Wed Jan 4 14:13:38 CET 2012

Hi Marcin!

posrot1 and posrot2 are indeed the commands that you need to rotate your source. It's a bit counter-intuitive at first because these commands manipulate your coordinate axes, but the source is fixed relative to the axes. This means that your source will always be aligned with the new z'-axis that you define.

To use the commands, you need to provide vectors. The first vector you provide is for posrot1: you provide the new x'-axis that you want. The second vector you need to provide is a vector in the x'-y' plane; this will define your y'- and z'-axes.

It's easier to understand with an example. In your case, your source is currently aligned along the z-axis, but you want it aligned with the original x-axis. You would use the following commands:

/gate/source/YOUR_SOURCE/gps/posrot1 0. 0. -1.
/gate/source/YOUR_SOURCE/gps/posrot2 0. 1. 0.

This means that you want your new coordinate system to point the x'-axis along the original negative z direction (i.e. a 90 degrees rotation around the original y-axis), and you want the new y'-axis to be the same as the original y-axis. Now your source is aligned along the new z'-axis, which happens to point along the original x-axis... which is what you wanted! Note that for posrot2, you need to provide a vector in the x'-y' plane, but I find it easier to just provide a vector along the y'-axis.

And if you want to do an arbitrary rotation? Break down your rotation into 2 angles: 1) a rotation of theta around the original y-axis and 2) a rotation of phi around the new x-axis. Then, the final x'-axis is given by the following vector (you would use that in posrot1):

( cos(theta), 0, -sin(theta) )

and the final y'-axis is given by (you would use that in posrot2):

( sin(phi)*sin(theta), cos(phi), sin(phi)*cos(theta) )

Just calculate the value of these vectors with the appropriate theta and phi angles.

I hope this helps anyone trying to rotate a source.



Marc Chamberland, MSc
PhD candidate
Department of Physics
Carleton University
Ottawa (ON)

Le 2012-01-04 à 7:09 AM, Marcin Balcerzyk a écrit :

> Hi Gaters.
> I wanted to create cylindrical source along x axis instead of default z
> axis. How can I do that? Gps does not seem to have rotation parameters -
> there are two undocumented posrot1 and posrot2 commands, but hard to
> understand for what they are. I found some explanation at
> http://reat.space.qinetiq.com/gps/gps_sum_files/Document.htm but it is not
> clear for me.
> Kind regards
> Marcin Balcerzyk
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users

More information about the Gate-users mailing list