# equation for an hexagon with rounded corners

I know a simple equation for a squircle, $$x^4+y^4=a^4$$

What would be the equation for an hexagon with rounded corners?

In the equation, how can I take in account for the angle of rotation of the hexagon about its center?

## 2 Answers

The following equation gives a rounded hexagon where $$\theta$$ can be changed in order to give any rotation of the hexagon about its centre and $$r$$ can be changed to affect the roundness of the hexagon itself. I found that $$r=15$$ works well. The value $$10$$ at the end of the equation can be increased to increase the size of the hexagon as well. $$\sum_{n=1}^6 \Big|x\cos{\Big(\frac{\pi n}{3}+\theta\Big)}+y\sin{\Big(\frac{\pi n}{3}+\theta\Big)}-\frac{1}{6}\Big|^r=10$$

polar $$r = 5 + \frac{1}{5} \cos (6 \theta)$$ looks very good. You can solve as rectangular using $$x = r \cos \theta$$ and $$y = r \sin \theta$$

The 6 is fixed, but you may adjust the ratio of coefficients as you like, for visual effect.