0
$\begingroup$

Let say I have these rectangles,

enter image description here

All the rectangles are in same shape. I know all the co-ordinates of all inner rectangles. I know the width and height of outer rectangle, which contain all inner rectangles. So, I know the center also. I need to rotate all these inner rectangle from center. After rotating I need the co-ordinates of all inner rectangles.

1 Answers 1

2

Simply transform the coordinates into coordinates relative to the center, and then apply the rotation matrix to each of the coordinates.

  • 0
    Can you please show me a simple example?2012-04-10
  • 0
    Say the center is at (1,5), and one of the coordinates of the inner rectangle was at (6,8), then the transformed coordinates would be (5,3). To rotate you would multiply the vector (5,3) by the rotation matrix.2012-04-10
  • 0
    Thanks. I will check that. If I rotate first then transform it. Then it will effect or not2012-04-10
  • 0
    Thanks your solution perfectly works for me. I am very very thankful to you.2012-04-10