How to manipulate Canvas elements: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 285: Line 285:
<syntaxhighlight>
<syntaxhighlight>
arrow.setTranslation(0,0);
arrow.setTranslation(0,0);
arrow.setScale(1.5,2);
arrow.setScale(2,4);
arrow.getScale();
arrow.getScale();
</syntaxhighlight> you get ''[9.5,19.5, 120.5,40.5]'' which are the values for [Sx, Sy].<br />
</syntaxhighlight> you get ''[2,4]'' which are the values for [Sx, Sy].<br />[[File:Scaled.png|none|Scaled arrow]]
Again, the BoundingBox and the intrinsic coordenate system remains unchanged.<br />
Again, the BoundingBox and the intrinsic coordenate system remains unchanged.<br />
=== Fundamental Equations ===
Now the general case, applying both Translation and Scaling:
<syntaxhighlight>
arrow.setTranslation(150,80);
arrow.setScale(2,4);
</syntaxhighlight>
The Fundamental Equations:
<big>'''''u = T<sub>x</sub> + x * Sx'''''</big>
<big>'''''v = T<sub>y</sub> + y * Sy'''''</big>
                                and his reciprocals:
<big>'''''T<sub>x</sub> =  u - x * Sx'''''</big>
<big>'''''T<sub>y</sub> =  v - y * Sy'''''</big>
'''Plot2D''' makes extensive use of these equations.
229

edits

Navigation menu