There’s no single shape known as a quatrefoil. It’s a family of shapes that look something like the figure above.
I wondered how you might write a fairly simple mathematical equation to draw a quatrefoil. Some quatrefoils are just squares with semicircles glued on their edges. That’s no fun.
Here’s a polar equation I came up with that looks like a quatrefoil, if you ignore the interior lines.
This is the plot of r = cos(2θ/3).
Update: Based on a suggestion in the comments, I’ve written another post on quatrefoils using an equation that has a parameter to control the shape.