Hi,
Can I recommend looking at:
http://mathworld.wolfram.com/RotationMatrix.html
http://mathworld.wolfram.com/EulerAngles.html
http://www.j3d.org/matrix_faq/matrfaq_latest.html (Q32, 34, etc)
you'll see there are lots of different conventions, in particular,
your concern about the placement of the signs in the matrices is
explained near the top of the first ref above.
I haven't got time to look at your +-pi/2 stuff closely, but I think
this is probably correct -- why do you say it shouldn't be? Rotations
of +-90 degrees align an axis with a previous one, so various
confusing things can happen, (including gimbal lock, 3rd ref above).
Best,
Ged.
Amir Tahmasebi wrote:
> Dear SPMers,
>
> I have a couple of questions about spm_matrix.m. I appreciate your
> consideration in advance:
>
> 1- While I was working with one of my datasets in SPM2 environment, I
> realized by applying a roll of (-pi/2) and a pitch of (pi/2), I get exactly
> the same result as a roll of (-pi/2) and a yaw of (-pi/2). I tried it on
> several other datasets and they confirmed that. But it shouldn't be! For one
> of my datasets, in order to bring it to correct radiological orientation, I
> had to apply the roll and pitch as I said and it confirms with what it
> should be but the roll and yaw of (-pi/2) doesn't make sense. I appreciate
> any help to clear this confusion for me.
>
> 2- I know a bit of robotics and in the beginning of working with SPM, I
> realized SPM developers define roll as rotation around Y axis, pitch as
> rotation around X axis and yaw as rotation around Z axis. In robotics it is
> roll for Z axis, pitch for Y axis and yaw for X axis. Is there any
> particular reason that the definition is different?
>
> 3- Also as I found in spm_matrix.m file, the rotation matrices are defined
> differently too. In R1, element r32 has the negitive sign (-sin(P(4))) but
> in robotics books, r23 has negative sign. The same thing for R3. Also the
> order of multiplication is XYZ (R1R2R3) however in robotics it is usually
> ZYX. Any particular reason?
>
> I appreciate any help,
>
> Thanks a lot,
>
> Amir Tahmasebi,
>
> Ph.D. Candidate
> School of Computing,
> Queen's University,
> Kingston, ON,
> Canada
>
|