Is there a way to get the angle of rotation from a svg transform matrix?

for example:

rectangle =

x = 0

y = 0

width = 200

height = 200

then I rotate the rectangle by 45 degrees and get

matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-41.421356,100)

is there a way I can extract the degree (in radians is fine) from the matrix. I'm hoping this is the final missing piece I need for what I'm working with.

<rect

style="fill:#b3b3b3;stroke:none"

id="rect3632"

width="200"

height="200"

x="0"

y="0"

transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-41.421356,100)" />

## Angle of Rotation from a transform matrix

### Re: Angle of Rotation from a transform matrix

For an SVG matrix of the form matrix(a,-b,b,a,c,d), where a and b are not both zero, the rotation angle is atan2(b,a). If an SVG matrix represents a rotation, then it will necessarily be of this form.

### Re: Angle of Rotation from a transform matrix

Perfect. Thanks very much.

### Who is online

Users browsing this forum: No registered users and 3 guests