Boost logo

Geometry :

Subject: [ggl] question regarding rotate_transformer strategy
From: Jeff Trull (jetrull)
Date: 2011-11-07 13:34:25


I was tracking down a rotation issue and I noticed that the 2D
rotation matrix (around Z) is defined as:

cos(angle), sin(angle), 0,
-sin(angle), cos(angle), 0,
0, 0, 1)

But in other sources I have seen it defined as:

cos(angle), -sin(angle), 0,
sin(angle), cos(angle), 0,
0, 0, 1)

And in fact, if you imagine a +pi/2 rotation from X [1, 0, 0] to Y [0,
1, 0] the current definition will give:

0, 1, 0,
-1, 0, 0,
0, 0, 1

which multiplied by [1, 0, 0] gives [0, -1, 0], which IMO is a -pi/2 rotation.

My math is a bit rusty, though. Am I understanding it wrong?

Thanks,
Jeff


Geometry list run by mateusz at loskot.net