Translate #4

#1 (50,50) #1 translated(0,100) --> (50,150) #1 translated(100,200) --> (150,250) #1 translated (200,420) --> (250,470)

Translate

Because of the way translation works (moving the origin), it results in an apparent movement of the object.

Our first (red) circle is centered at (50,50).

<circle id="circle1" cx="50" cy="50" r="30" fill="red"/>

Our blue circle uses that circle, but it is 'translated' down by 100 pixels. This puts it at (50,50+100).

<g transform="translate(0,100)">
<circle id="circle2" cx="50" cy="50" r="30" fill="#abcdef"/>
</g>

This green circle also started out at (50,50) as blue, but now resides at (150,250).

<g transform ="translate(100,200)">
<circle id="circle3" cx="50" cy="50" r="30" fill="blue" style="fill:lightgreen"/>
</g>

To calculate the 'real' offset of a translation, we need to start with the starting values, and add the 'translated' values to them.

Or, to move an image to a particular location, we would subtract the starting values from the desired values

To 'translate' the red circle so it sits at the center of the bottom border, we would have to 'translate' it to [(500/2)-50,500-50-30] = [200,420].

<g transform="translate(200,420)">
<circle cx="50" cy="50" r="30" fill="orange"/>
<circle cx="50" cy="50" r="1" fill="black"/>
</g>

Recall that circles are indexed by their center.

So the math works out thus: