An antenna has to concentrate energy in some directions at the expense of others. Suppose that within a cone of semi-angle alpha radians it concentrates all its energy uniformly, whilst radiating none outside this cone.
The cone cuts the sphere in a curved surface of area A, whereas the area of the sphere is 4 pi R^2. Thus the directivity of this antenna is (4 pi R^2)/A as a numerical factor.
For small and moderate angles alpha, the area of the plane disk at the mouth of the cone is very nearly equal to the area of the curved section of the sphere. Thus we can say approximately that A = pi (R alpha)^2 and the directivity is (2/alpha)^2. If we call the numerical directivity D (dimensionless), then the semi-angle of the beam is given by alpha = 2/(sqrt(D)).
The corresponding beamwidth is (2 alpha) = 4/(sqrt(D)) radians. Or, the beamwidth in degrees is (180/pi)*4/sqrt(D) degrees.
The directivity D here is just a numerical factor. Of course, the directivity (or gain assuming 100% efficiency) of an antenna is often quoted in dBi, which we can call for convenience DirectivitydB
DirectivitydB = 10 logD = 20 (log2 - logalpha), always providing alpha is less than a radian.
Of course, the actual gain of the antenna is the directivity times the efficiency, so in dB we have to subtract -10log(efficiency); thus if the efficiency is 80% the actual dB gain = DirectivitydB - 0.97.
For example, if alpha = 1 degree = (2 pi)/360 radians then DirectivitydB = 41 dBi to the nearest dB.
If alpha = 10 degrees = (2 pi)/36 radians, then DirectivitydB = 21 dBi to the nearest dB.
If alpha = 20 degrees = (4 pi)/36 radians then DirectivitydB = 15 dBi to the nearest dB.
For practical beams, where the radiation does not suddenly fall to zero at the cone edges, we may take the beamwidth between -3dB contours as (2 alpha), as alpha is the cone semi-angle. There is a further approximation involved here.
The error due to approximating the curved area of the sphere by the plane disk, at a beamwidth of 40 degrees (gain 15 dBi) (alpha = 20 degrees) is less than 3% in numerical directivity or about 0.2 dBi. The error in the estimate is on the high side of the actual value.
The estimate may also be applied to practical beam shapes, but the error is then harder to quantify. It should be stressed that this figure is only an estimate; it can be generalised to non-conical beams, but in general, the estimate is sensitive to details of the beam profile and radiation pattern, and to the sidelobes, so knowledge of the half-power beamwidths in azimuth and elevation is insufficient to arrive at a truly accurate prediction of the directivity.
For a non-conical beam shape we can very roughly approximate the area of the beam footprint on the unit sphere as the product of the beam widths in E-plane and H-plane, or in azimuth and elevation. Since there are (4 pi) steradians in a sphere (the area of a sphere of unit radius is (4 pi)), then because there are 360/(2 pi) degrees in a radian so there are [(360/(2 pi)]^2 square degrees in a steradian and this number is about 3282, there are (4 pi 3282) = 41,253 square degrees in a complete sphere.
This further approximation assumes a "curved rectangular" kind of beam profile.
Thus we can write that the numerical directivity is (41,253)/[E-plane beamwidth times H-plane beamwidth] where the beamwidths are given in degrees. Very approximately. In dBi the directivity is 10 log[base10] of this estimate.
A measure of the spreading effects of diffraction, of amplitude illumination taper and of reflector profile errors, which is independent of the wavelength and antenna size, is given by
Beam Factor = beamwidth*D/lambda
where D is the dish diameter in metres and lambda is the wavelength in metres.