Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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 -> PointSize@.02, GridLines -> Automatic, Frame -> True,
               PlotRange -> ran},
       Popt = {Evaluated -> True, ColorFunction -> "Rainbow", PlotPoints -> 20,  
               PlotRange -> {{-ran, ran}, {-ran, ran}, All}}
      },
  DynamicModule[{pkt = {{0, 0}}},
   Row[{
        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

share|improve this answer
    
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. –  CRJ Oct 22 '13 at 13:48
    
Out of curiousity though, what is the precision here? Can it be turned down to achieve a speedup? –  CRJ Oct 22 '13 at 13:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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