Thanks! Also I realised something really interesting. I can actually apply the min function on the relative units. So something like this will work:
c = circle(0.5w, 0.5h, min(0.5sx, 0.5sy))
beside(c, stack(c, c))

This allows me to always take the shorter side’s radius, regardless of dimensions of the context!