You are on page 1of 4

Functions used in optics Contents cyl function (circular aperture) somb (sombrero) function ring delta function composite

function example anamorphic functions 2D triangle function (separable) 2D triangle function (radially symmetric) polygon function cyl function (circular aperture) close all; [x,y] = meshgrid(linspace(-4,4,251)); r = sqrt(x.*x+y.*y); z = cyl(x/3,y/3); mysurf(x,y,z); imshow(z); somb (sombrero) function close all; [x,y] = meshgrid(linspace(-4,4,251)); r = sqrt(x.*x+y.*y); z = somb(r); mysurf(x,y,z); r = linspace(-4,4,251); z = somb(r); plot(r,z); ring delta function close all; [x,y] = meshgrid(linspace(-4,4,251)); r = sqrt(x.*x+y.*y); z = gaus((r-2)/0.2); mysurf(x,y,z); imshow(z); composite function example

We use gaus to simulate delta function

x = linspace(-2,2,401); y = gaus(sin(pi*x)/0.2); plot(x,y,'k','LineWidth',2); axis([-2 2 0 1.5]); anamorphic functions [x,y] = meshgrid(linspace(-4,4,251)); z = rect(x/3).*rect(y/2); imshow(z); z = cyl(x/3,y/2); imshow(z); 2D triangle function (separable) close all; [x,y] = meshgrid(linspace(-4,4,251)); z = tri(x/2).*tri(y/2); mysurf(x,y,z); imshow(z); 2D triangle function (radially symmetric) close all; [x,y] = meshgrid(linspace(-4,4,251)); r = sqrt(x.*x+y.*y); z = tri(r/2); mysurf(x,y,z); imshow(z); polygon function % triangle [x y] = meshgrid(linspace(-4,4,251)); z = polygon(x,y); imshow(z); % hexagon theta = (pi/3)*(0:5); p = [cos(theta') sin(theta')]; z = polygon(x,y,3*p); imshow(z);

2.4 The Dirac delta function The Dirac delta function (x) is defined by the reproducing property, i.e., dx(xx)f(x)=f(x) for any function f(x).6 This is equivalent to the following explicit definition (further forms are discussed in the Mathematica examples), see also Fig. 2.1. (x)=12dzeizx12limLLLdzeizx=12limLx2sin(Lx)

Figure 2.1: A sketch of 12x2sin(Lx) for a few values of L. This function converges to a Dirac delta function It is often useful to think of the function as the limit of a simple function, and one example is an infinitely narrow spike, as in Fig. 2.2 for a0. Figure 2.2: A sketch of a piecewise constant function, that in the limit a0 gives the Dirac delta function Important properties Since integration with the function samples f(x) at the single point x=x, we must conclude that (xx)=0 for xx The area under the function is 1, as can be seen from taking f(x)=1. Combining the last two results leads to an interesting expression for the area under the curve, x+x(xx)=1 for any 0 A very useful relation is obtained when we scale the variables in the delta function (y=ax) dx(a(xx))f(x)=sign(a)a1dy(yy)f(ya)=af(ya)=af(x) We can interpret this is as the contribution from the slope of the argument of the delta function, which appears inversely in front of the function at the point where the argument of the function is zero. Since the function is even, the answer only depends on the absolute value of a. Also note that we only need to integrate from below to above the singularity; it is not necessary to integrate over the whole infinite interval. This result can now be generalised to a -function with a function as argument. Here we need to sum over all zeroes of the function inside the integration inetrval, and the quantity a above becomes the slope at each of the zeroes, badxg(x)f(x)=idfdxg(x)x=xi

where the sum extends over all points xi in ab where f(xi)=0. Example 2.6: Calculate the integral f(x)(x2c2t2) Solution: Let us first calculate the zeroes of x2c2t2, x=ct.. The derivative of x2c2t2 at these points is 2ct, and thus f(x)(x2c2t2)=12ctf(ct)+f(ct) Integrals such as these occur in electromagnetic wave propagation.