# How can I draw a circle around a rectangle?

In Inkscape, I can draw a perfect circle inside a rectangle (circle touches all sides of the rectangle):

However I can't make the opposite: making the circle around the box:

Okay, this is almost perfect though I wish to know how can I make the circle snapping to the edges of the box. Currently circle's bounding box is snapping to everything, but I wish the circle itself to snap.

I also tried converting this circle to path, makes no difference.

How am I supposed to achieve this:

Preferrably:

• Not by resizing the circle based on eye
• Not by resizing the circle based on complex math (although I could do it, but I can't write sqrt in circle's Rx and Ry)
• There is no such snapping function. This in general is the reason many mechanical engineers moved over to constraints based solving. It is impossible to guarantee everything can be done by a drag as you go snapping environment. There's just too many conditions where describing the intention correctly would be nightmare. Mar 20, 2023 at 10:46
• @Joojaa - have to agree here. Also if this is for engineering purposes then Inkscape or any Bézier based vector tool is not the right tool - as they're not accurate enough. No perfect circles! Mar 20, 2023 at 11:29
• inkscape has a curcle primitive @BillyKerr it can be perfect atleast untill you convert to beziers Mar 20, 2023 at 14:23
• @joojaa Yeah, but it will most likely have to converted to a bézier path if the OP is going to use it to cut something out. If this is just for a graphic, then it's no big deal, but for anything requiring precision, it's not going to work. Mar 20, 2023 at 14:32

Here's one possible method

1. Make sure the circle is exactly in the middle of the square (snap to centres), and that snapping is enabled

2. Rotate the circle by 45° in the Transform Rotate panel, this will align the nodes with the nodes of the square so that you can snap to them.

3. Do Path > Stroke to Path

4. If you have the grid enabled, switch off snap to grid

5. Click and drag the corner handle of the circle bounding box while holding down Ctrl+Shift until the inside path of the circle snaps to the corner nodes of the square

• Ctrl+Alt doesn't work for me, however Ctrl+Shift does (Windows 11). Mar 20, 2023 at 11:15
• @Daniel - Sorry my mistake, a typo, it is Ctrl+Shift, I've edited it now. Mar 20, 2023 at 11:17

You can use the 'Ellipse from Points' path-effect.

Open the 'Path → Path Effects...' panel, select your rectangle and add a new effect. In the following list look for 'Ellipse from Points' (not 'Ellipse by 5 points') and that's pretty much it. There are a few parameters you can play around with inside the panel and it also works for other kinds of path-like objects. You may want to duplicate your original rectangle before adding the effect, so you can style it independently.