How does a hula hoop master gravity? Mathematicians prove that shape matters