# Delay-and-sum beamforming: implementing steering in C

I am currently trying to understand how delay-and-sum beamforming works. I have found this website which explains the process of this technique very well in which the following C code is provided:

#include <stdio.h>
#include <math.h>

#define ANGLE_RESOLUTION 500    // Number of angle points to calculate

int main(void)
{
int numElements = 4;         // Number of array elements
double spacing = 0.2;        // Element separation in metres
double freq = 1000.0;        // Signal frequency in Hz
double speedSound = 343.0;   // m/s
int a;
int i;
// Iterate through arrival angle points
for (a=0 ; a<ANGLE_RESOLUTION ; a++)
{
// Calculate the planewave arrival angle
double angle = -90 + 180.0 * a / (ANGLE_RESOLUTION-1);
double angleRad = M_PI * (double) angle / 180;
double realSum = 0;
double imagSum = 0;
// Iterate through array elements
for (i=0 ; i<numElements ; i++)
{
// Calculate element position and wavefront delay
double position = i * spacing;
double delay = position * sin(angleRad) / speedSound;

realSum += cos(2.0 * M_PI * freq * delay);
imagSum += sin(2.0 * M_PI * freq * delay);
}
double output = sqrt(realSum * realSum + imagSum * imagSum) / numElements;
double logOutput = 20 * log10(output);
if (logOutput < -50) logOutput = -50;
printf("%d %f %f %f %f\n", a, angle, angleRad, output, logOutput);
}
return 0;
}


Beamforming works by steering to the direction that we want to listen to. Since the above code calculates the delay for -90 to 90 degrees, I thought that it was steering for a sound wave coming from -90 to 90 degrees.

But when going all the way down to that same website, it states "So far the main lobe of the array's sensitivity pattern has been fixed to a single direction; perpendicular to the array."

From that statement, I deduce that the above C code wasn't steering at all? If not, how could I implement it?