bcs = y-(x-1);
if (bcs<1) % this limits the maximum value
bcs = 1;
end
else
bcs = 47-y-(x-1);
if (bcs <1) %> 46)
bcs = 1; %46;
end
end
The LFR element can now be written:
% this neat trick does an interpolation to the boundary
% the cost, of course, is a divide!!!
if (y < 23) % this is the easy way for half the region
lfr3d(47-x,47-y) = -sin_tbl(y)+gf_diff(bcs);
else
tmp = ((47-y-x)/(47-y))*gf_diff(y);
lfr3d(47-x,47-y) = -sin_tbl(y)+tmp;
end
Note that the sign of gf_diff is positive in the equation above. Thus gf_diff cancels the
value of sin(cs), reducing the value of the element to zero along the first part of the lr=0
axis. See Figure 21 (above).