1
votes

problem explain: transform = "matrix(cos(a), sin(a), -sin(a), cos(a), -x1cos(a)+y1sin(a)+x2, -x1sin(a)-y1cos(a)+y2)" can see 7.4 Coordinate system transformations
to be resolved: in my work,i must resolve to parse matrix example:

<?xml version="1.0" encoding="utf-8"?><svg width="800" height="500" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:PerfectSVG="http://www.perfectsvg.com/PerfectSVG" xml:space="preserve">
<defs>
<symbol overflow="visible" id="symbol1" connectPoints="15 70 50 0 87 68">
<g>
<line x1="300" y1="200" x2="309" y2="200" transform="matrix(1,0,0,1,0,0)" />
<line x1="311" y1="200" x2="320" y2="200" transform="matrix(1,0,0,1,0,0)" />
<line x1="300" y1="200" x2="304.75" y2="207.75" transform="matrix(1,0,0,1,0,0)" />
<line x1="315.75" y1="207" x2="320" y2="200" transform="matrix(1,0,0,1,0,0)" />
<line x1="309.25" y1="197.5" x2="309.25" y2="202.25" transform="matrix(1,0,0,1,0,0)"/>
<line x1="311" y1="197.25" x2="311" y2="202.5" transform="matrix(1,0,0,1,0,0)"/>
<line x1="313.75" y1="205.5" x2="318" y2="208.5" transform="matrix(1,0,0,1,0,0)"/>
<line x1="302.75" y1="209.5" x2="307.25" y2="206" transform="matrix(1,0,0,1,0,0)"/>
<line x1="303.75" y1="211" x2="308.25" y2="207.5" transform="matrix(1,0,0,1,0,0)"/>
<line x1="306" y1="209.25" x2="310.25" y2="215.5" transform="matrix(1,0,0,1,0,0)"/>
<line x1="312.75" y1="207.25" x2="317.25" y2="210.5" transform="matrix(1,0,0,1,0,0)"/>
<line x1="310.25" y1="215.25" x2="314.5" y2="208.75" transform="matrix(1,0,0,1,0,0)"/>
</g>
</symbol></defs><use xlink:href="#symbol1" transform="matrix(3.774,-2.246,2.246,3.774,-1562.468,-12.947)" stroke="#000000" fill="#FFFFFF" id="use3" stroke-width="0.2276867"/></svg>

Now: i want to know In:transform="matrix(3.774,-2.246,2.246,3.774,-1562.468,-12.947)" out:(a:angle x1,y1:The original coordinates x2,y2:New coordinates) from the example

who can give suggestions or Some reference materials

tks.

1

1 Answers

-1
votes

It's impossible to get old x/y and new x/y only by transform data. You must have two of the three data.

You can use getBBox method to get the outer box, and then you can get the box's dots.