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.

plotSurface(obj, nGrid, drawI)
function h = plotSurface(obj, nGrid, drawI)
% plotSurface - plot an objects surface in reference position
% (obj.translation=[0 0 0], obj.rotations=[0 0 0]) 
%
% h ....... the figure handle to draw on
% obj ..... object to draw
% nGrid ... interpolate surface anew at [N M] points
% drawI ... draw intensity, logical true/false

% get surface in reference position and interpolate data
[X, Y, Z, E] = interpolateGrid(obj, 'surface', nGrid);

% show surface
if drawI	
	if isfield(obj, 'saturation') && ~isempty(obj.saturation)
		surf(X, Y, Z, obj.saturation(E.*conj(E)));
	else
		surf(X, Y, Z, E.*conj(E));
	end
else
	surf(X, Y, Z);
end
xlabel('x');
ylabel('y');
zlabel('z');
colorbar;
shading flat;

Contact us