In a previous question of mine, I asked how one might draw an Airy disk on a plane: Generating an Airy disk on a plane, and recieved some impressive answers from the users Timothy Wofford and m_goldberg

Might it be possible to have a 2D plane in the contexts of a Graphics3D environment, and generate an Airy disk wherever one clicks (a simpler 2D Gaussian curve would also be just fine)? Or, perhaps more simply, to generate such disks at a specified set of two-dimensional coordiantes? The hope is that this can be done s.t. overlapping sections of one or more curves can be summed.


1 Answer 1


The most important questions are:

  • what do you need it for and what precission you are after?
  • Is the field od peaks going to be dense?
  • Airy function is disappearing very fast so maybe it's not important to keep track of the area outside the second minimum and approximation with 0 there is sufficient?

You can answer those questions and adjust the following code as you need. Here it is the straightforward implementation so it can be a little bit slow while adding points.

Model by Timothy Wofford:

airy2[{x_, y_}, {x0_, y0_}] := With[{s = Sqrt[(x - x0)^2 + (y - y0)^2]},
                                    (2 BesselJ[1, s]/s)^2]

With[{ran = 15},
 With[{opt = {ImageSize -> 300},  
       Gopt = {BaseStyle -> [email protected], GridLines -> Automatic, Frame -> True,
               PlotRange -> ran},
       Popt = {Evaluated -> True, ColorFunction -> "Rainbow", PlotPoints -> 20,  
               PlotRange -> {{-ran, ran}, {-ran, ran}, All}}
  DynamicModule[{pkt = {{0, 0}}},
        ClickPane[Graphics[Dynamic@Point[pkt], opt, Gopt], AppendTo[pkt, #] &]
        Dynamic @ Plot3D[Plus @@ (airy2[{x, y}, #] & /@ pkt),
                         {x, -ran, ran}, {y, -ran, ran}, opt, Popt]


enter image description here

  • $\begingroup$ This is just for a visualization application for a couple of points, and the field of points is not going to be very dense. So this is pretty much precisely what I was looking for. You make a good point that we should be able to zero-out the ring around the base of the Airy function curve without much effect. $\endgroup$
    – CRJ
    Commented Oct 22, 2013 at 13:48
  • $\begingroup$ Out of curiousity though, what is the precision here? Can it be turned down to achieve a speedup? $\endgroup$
    – CRJ
    Commented Oct 22, 2013 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.