SVG elements have different transform origin than regular html elements.
So you have to reset the transform to work from the center (not top left).
This page contains information I gathered and thought were very useful. See more notes on programming.
Just to let you know, this page was last updated Thursday, Jan 18 18