/**
 * Calculate antenna pattern loss for sector antennas.
 * Based on 3GPP antenna model.
 *
 * @param angleOffBoresight - Angle from antenna boresight (0-180 degrees)
 * @param beamwidth - 3dB beamwidth in degrees
 * @returns Pattern loss in dB
 */
export function calculateSectorPatternLoss(
  angleOffBoresight: number,
  beamwidth: number = 65
): number {
  const theta3dB = beamwidth / 2;
  const sideLobeLevel = 20; // dB

  return Math.min(
    12 * Math.pow(angleOffBoresight / theta3dB, 2),
    sideLobeLevel
  );
}
