title: Rotate a set of object coordinates
body: <p>I have a bunch of objects (ActiveRecord) that have x and y coordinates relative to a HTML5 canvas element. I need to rotate sets of them by different number of degrees (in 90 degrees increments) and then store them again for a one time data migration.</p>
  
  <p>These objects are all relative to a canvas element so the coordinates start at (0,0) and I  would like them to stay in that quadrant (bottom right), if possible. I assume that I need to do a rotation around (0,0) and then a translation down and right.</p>
  
  <p>Is there a way I can write a block that will do this? Any help is appreciated.</p>
  
  <p><strong>Update</strong>: did some edits to make it clearer after some questions.</p>
  
  <p>Thanks.</p>