I may be wrong here, but I think this should be something like 1/2 distance from 0 0 0 to 2r, 2r, l (thinking of a box containing the cylinder)
and this would be sqrt(4r^2 + 4r^2 + l^2)/2 = sqrt(8r^2+l^2)/2