How to calculate the depth and width of a beam