% the angular response function, g(phi,theta)
function p = g(theta,phi)

N = length(theta);
p = zeros(1,N);

% Simple triangular response function
theta0 = pi/180*9; % This width is estimated from experimental setup
for i = 1:N
    if (abs(theta(i)-phi)<theta0)
        p(i) = 1/theta0*(1-abs(theta(i)-phi)/theta0);
    else
        p(i) = 0;
    end
end