Code covered by the BSD License  

Highlights from
Huygens-Fresnel integral approximation, free-form apertures and rough surfaces

image thumbnail

Huygens-Fresnel integral approximation, free-form apertures and rough surfaces

by

 

Simulate wave propagation through free-form apertures, or off rough surfaces.

getReflection(in, Sn)
function im = getReflection(in, Sn)
% getReflection - compute the ideal reflection of incident light in every
% point of a grid
%
% im ... reflection, inverted & mirrored light propagation vector
% in ... light propagation vector
% Sn ... surface normals

% main lobe direction, total reflection - mirror around surface normal
ina = (in'*Sn) ./ sqrt(sum(Sn.^2));
ina = ina(ones(3,1),:) .* Sn;           % projection on surface normal A
im  = in(:,ones(1,size(ina,2))) - 2*ina;

% normalize
imAbs = sqrt(sum(im.^2));
im    = im ./ imAbs(ones(3,1),:);

Contact us