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.

surfaceNormal(a)
function b = surfaceNormal(a)
% surfaceNormal - Compute the surface normal of a plane, given its
% rotations. The unit vector is rotated around x -> y -> z.
%
% input:	a ... [alpha beta gamma] in degree, either row/column
% output:	b ... [x; y; z], a column vector surface normal, length 1

alpha = a(1);							% angles
beta  = a(2);
gamma = a(3);

Rx = [1          0           0;...		% rotation matrices
      0 cos(alpha) -sin(alpha);...
      0 sin(alpha)  cos(alpha)];
Ry = [ cos(beta) 0 sin(beta);...
               0 1         0;...
      -sin(beta) 0 cos(beta)];  
Rz = [cos(gamma) -sin(gamma) 0;...
      sin(gamma)  cos(gamma) 0;...
               0           0 1];
		   
b = Rz*Ry*Rx*[0 0 1]';					% the rotation

Contact us