The rotation is counter clock-wise (i.e., mathematically positive, unless invert=f is used) as seen from the right-handed xyz-axes; a z rotation will rotate the x axis towards the y axis; a y rotation will rotate the z axis towards the x axis; a x rotation will rotate the y axis towards the z axis.
Although by default all vectors are rotated by the same matrix, the keyword select= can be used to select any set of Position, Velocity or Acceleration.
set pa=39
set inc=-45
set phi=-34
snaprotate bar.dat n7476.dat "atand(tand($phi)/cosd($inc)),$inc,$pa"
zyz
snapplot n7476 psize="z>0?0.03:0.0"
where psize was choosen such that ``near'' (z>0) particles were plotted a bit
bigger to accentuate the near side of the model. Flipping the sign if $inc
will flip the near and far side.
For 'normal' spiral galaxies the following
example shows how to project them into their normaly sky view, taking the
sense of rotation into account:
set pa=170 # M51, use pa=-160 for M33
set inc=22 # M51, use inc=30 for M33
set sign=-1 # M51, use sign=1 for M33
set sinc=`nemoinp "iflt($sign,0,$inc,-$inc)"`
mkdisk - 1000 sign=$sign |\
snaprotate - - theta=$sinc,$pa order=yz |\
snapgrid - velfie.ccd mom=-1
nds9 velfie.ccd # view the velocity field using 'ds9'
With sign=-1 it will create a counter-clockwise rotating disk and project
it using $inc,$pa, For a clock-wise rotating disk the math is nearly the
same, except the sign for the inclination needs to be flipped, or -$inc,$pa,
hence the somewhat awkward looking expressing to compute sinc.
xx-jan-88 V1.0 original JEB 3-oct-88 V2.1 eulerian angles (order=zyz) PJT 17-feb-89: V2.1a new get+snap macros redef's PJT 27-nov-89: V2.1b cosmetic defv[] PJT 15-nov-90 V3.0 theta is now an array keyword PJT 1-jun-92 documented the rotation manner bit more precise PJT 11-jun-92 V4.0 rotation now defined in math sense PJT 21-nov-98 V5.0 added tscale= keyword PJT 18-nov-05 V5.1a added select=, also implemented select=acc PJT