Calculate the correct diameter.