xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: convert matrix to rotation
Date Sat, 11 Aug 2007 18:26:26 GMT
Hi BigLiu,

BigLiu <bigliu@gmail.com> wrote on 08/02/2007 05:19:03 PM:

> In original SVG file exported from Illustrator we have: 
> 
> <rect width="222.92" height="167.19" x="22.54" y="33.61"
> transform="matrix(0.9509 -0.3095 0.3095 0.9509 -29.6934 47.2265)" />
> 
>  I have some java code that will reverse engineer this to
> 
> <rect width="222.92" height="167.19" x="22.54" y="33.61"
> transform="translate(-29.6934 47.2265) rotate(-18)">
> 
> But actually I really need is to make it even simpler: 
> 
> <rect width="222.92" height="167.19" x="newX" y="newY"
> transform="rotate(-18)">

   To do this you need to map your translate through the rotate
transform.  I think this can be done by mapping the X,Y (translate) 
pair through the inverse of the rotation matrix.

> newX could be: 22.54 + translateX*somefactor   or some formula based on
> original matrix value
> newY could be: 33.61 + translateY*somefactor  or some formula based on
> original matrix value
> 
> I want to get rid of translate(translateX, translateY) in the transform 
tag.
> We have some tool only know how to do rotation based on x, y and 
rotation. 
> 
> I can not figure out the formula. Can anyone please help? 
> 
> Really appreciate. 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message