Write the distance y across the flat sides of a hexagonal nut as a function of r (see figure in the website below).

www.webassign.net/larpcalclim2/4-8-049.gif
y=