# Step 4: Computation of the Antenna Gain for Selected Directions

- The points in the horizontal plane (including
*M*) are computed._{geo} - The maximum gain in the horizontal plane is determined.
- The points on the vertical plane, defined with
*M*the vector of the z-axis and the vector from_{geo}*M*to the point with maximum gain, are computed._{geo} - The point with a maximum gain in the vertical pattern is determined. If this point is
not in the horizontal plane, the horizontal plane is parallel moved from
*M*to this point with maximum gain, and the horizontal pattern is recomputed in this plane._{geo}

The computation is made in the coordinate system defined in step 2.

An arbitrary point *P* has the coordinates (*x _{P}*,

*y*,

_{P}*z*) and is on the spheroid used for the computation. The difference vector δ between

_{P}*P*and

*Mgeo*is defined as:

Standardized to a length of 1 m this leads to the vector Δ

Point *P* and vector
$\Delta $
described in the 3D antenna pattern the following azimuth
α and tilt ϑ:

(assuming the x-axis is equal to 0°, and the y-axis is equal to 90°).

(assuming 0° is equal to the positive z-axis and 90° is horizontal plane)

For the computation of the first horizontal pattern, ϑ is equal to 90° and α is incremented between 0° and 360°. For the computation of the vertical pattern, α is equal to 0° and ϑ is incremented between 0° and 180°. In 3D computation mode, both angles must be incremented to sample all directions.