# How to place a path by its center point?

Suppose I have a closed path that looks like:

`````` _
| |_
|___|
``````

I want to draw, within that path, a scaled version of it so that the centers of the two figures are the same. That is, wherever this path is located, I wan't to be able to draw a similar path within this path.

A possible solution would be to move a path by its center point. Any suggestion? Thanks!

-
You could use the `local bounding box` feature of TikZ, however you would get then only the center of the outer rectangle of the path. Would that be ok? – Martin Scharrer Oct 26 '11 at 16:38
I'm not sure, but it may do the trick in my case. How would you go for getting the center of the bounding box of a path, then? Thanks! – Michaël Oct 26 '11 at 18:20

If I'm understanding you correctly, you want to draw a figure, and pick a point in it (which may be the center of mass, or may not) and scale the figure down to a copy of itself, with the center of scaling at the point you chose. If this is so, you want the `scale = <factor>` option: put this in the `\draw` command for the second shape, and all the coordinates will be scaled (around the origin `(0,0)`) by `<factor>`. If you want to scale around another center, use the option `shift = {(<x>, <y>)}` (note the braces) first.
You have to figure out what `<x>` and `<y>` are if you want to scale around a different center. One easy out is simply to draw your big shape so that its center of mass is actually at the origin. If you don't want to compute the center of mass yourself, you can use the method I describe in my answer Finding centroid of the content in whole tikzpicture, scope or node to have TikZ do it for you.
There's a `scale around` key? – Ryan Reich Oct 26 '11 at 19:30