Simulate Pivot Rotate Using Transform In SVG

Posted by Dested on Stack Overflow See other posts from Stack Overflow or by Dested
Published on 2010-03-13T06:46:47Z Indexed on 2010/03/13 6:55 UTC
Read the original article Hit count: 722

Filed under:
|
|
|
|

I have a rectangle in SVG that I need to rotate on a pivot from a specific point. The best way I can see to do this is transform to the xy of the pivot, rotate the degree, and then transform again. The problem is the xy of the second transform. I assume its going to take cos and sin to some extent, just not sure where or why.

*
|
|
|

would rotate -90degrees to

*---

Maybe im looking at this the wrong way, can anyone clearify?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about canvas