xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CONTR J9C880" <Michael.Bis...@je.jfcom.mil>
Subject RE: Scaling around a center point...
Date Fri, 09 Dec 2005 17:38:24 GMT
     Yeah, I'm learning more about transforms than I really want to.  Oh well, it helps. 
Unfortunately, applying a rotate to a transform seems to really screw up scaling AND translating.
 Looking at the matrix, it makes sense as to why.  If I draw an element to the JSVGCanvas,
and want to be able to move, scale, and rotate it without one operation hosing up another,
how do I achieve this?  I had scaling and translating down pat, but rotation breaks everything.
Michael Bishop


From: Tonny Kohar [mailto:tonny@kiyut.com]
Sent: Thu 12/8/2005 8:08 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Scaling around a center point...


On Thu, 2005-12-08 at 10:53 -0500, Bishop, Michael W. CONTR J9C880

> transform="translate(x, y) scale(x, y) rotate(t)"
> Is there a way to get the value of t?

the value of T will be cos(t) from transform matrix element 0,0

- rotate(t)
[   cos(theta)    -sin(theta)    0   ]
[   sin(theta)     cos(theta)    0   ]
[       0              0         1   ]

- rotate(t,x,y)
[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
[       0              0               1        ]

from AffineTransform Java API doc

Tonny Kohar
SVG Graphics Editor

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

View raw message