6.6 Technique: Scaling Around a Center Point
While it's possible to rotate around a point other than the origin, there is no corresponding
capability to scale around a point.
You can, however, make concentric symbols with a
simple series of transformations. To scale an object by a given factor around a center
point, do this:
translate(-centerX*(factor-1), -centerY*(factor-1))
scale(factor)
stroke-width:factor
Example 1
Scaling around a center point (50,50)
<svg width="200px" height="200px" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" r="2" style="fill:black"/>
<g id="box" style="stroke:black; fill:none">
<rect x="80" y="90" width="40" height="20"/>
</g>
<use xlink:href="#box" transform="translate(-100,-100) scale(2)" style="stroke-width:0.5" />
<use xlink:href="#box" transform="translate(-150,-150) scale(2.5)" style="stroke-width:0.4" />
<use xlink:href="#box" transform="translate(-200,-200) scale(3)" style="stroke-width:0.33" />
</svg>