2D and Circuit Directive Gain
Directive Gain is the ratio of the radiation intensity at a specified observation angle to the average radiation intensity. For the observation angle (q,f), the directivity is:

where U is the radiation intensity, which is defined as:

The average radiation intensity is related to the radiated power by:

Directivity
Directivity is the maximum value of Directive Gain, or:

Reference
Warren Stutzman and Gary Thiele, Antenna Theory and Design, Wiley, 1981.