Hi Martin,
thank you for your help.
The problem I have at the moment is it seems to me that
one gets the angle (the smaller of the two complementary)
but does not know about the sign then.
For example for a rotation matrix R representing a rotation
about an axis a = [42.25 -2.5 -75]', which normalized is
a_hat =~ [0.4906, -0.0290, -0.8709],
and an angle t = 2*pi - 0.3
I get back the result
ab =~ [-0.4906, 0.0290, 0.8709]
and
tb = 0.3
A good result would be tc = -tb and
ac = -ab though.
I cannot find any bug in my program. I am comparing
the rotation matrices resulting conversions for all
alternations (changing sign, taking complementary angle)
of the result ab/tb with the original R and take the
first matching one. However, in this case this tells me 0.3
should be correct.
I think it might be because of the complementary direction
of the axis. I one inverts the axis, does one also have to invert the
angle to represent the same rotation?
The method to obtain a rotation matrix from the axis and angle representation
tells me yes, one has to.
If it would be so, there are even more ways to
represent the same rotation matrix by axis and angle.
Namely, for an angle t in range [-2*pi,2*pi] (without zero) and an axis
a these equivalent combinations would be
t, a
t - (t / abs(t)) * 2 * pi, a
-t, -a
-(t - (t / abs(t)) * 2 * pi), -a
where t - (t / abs(t)) * 2 * pi gives the complementary
angle of t's in the defined range.
Do you already have some program
ready to convert from axis and angle to rotation matrices? If so, could
you backcheck this by just trying these combinations for a non-trivial
axis and angle pair
and comparing the resulting matrices?
Thanks again,
Sven |