How can I rotate a
{1,0,0}
vector by 180 degs on Z axis with quaternions so the result is
{-1,0,0}
, or if I rotate by 90 degs the result is
{0,1,0}
. Quaternion rotation always introduces some infinitesimal garbage, while in contrast, for example,
maketransform()
performs the proper result. Is the problem the angle conversion? Because
radians(180) == PI
outputs
0
.
vector v = {1,0,0} ;
v@quata0 = qrotate(quaternion(PI, {0,0,1}), v) ;
v@quatb0 = qrotate(quaternion(radians(180), {0,0,1}), v) ;
v@quata1 = qrotate(quaternion(PI/2, {0,0,1}), v) ;
v@quatb1 = qrotate(quaternion(radians(90), {0,0,1}), v) ;
s@n_spacer = "" ;
v@mat0 = v * maketransform(0, 0, 0, set(0,0,180), 1) ;
v@mat1 = v * maketransform(0, 0, 0, set(0,0,90), 1) ;