Fraunhofer diffraction on an arbitrary hole
The goal is to calculate integral
for some set of directions s.
General idea is to approximate hole by a set of squares.
For each square of size a x b with center at (0, 0) solution is trivial:
Solutions for each square are summarized with regard to phase difference. Note that geometric center of hole is considered as point with zero field initial phase.
Red, green, blue, yellow, magneta, cyan and fancy(just try it) colors are availbale. If no color is specified white color will be used.
Run
python3 diffraction.py %colorname
Then draw contour of hole and press "finish".
For higher resolution change variable color_grid_size
from 300 to 600. Note that it will slow down calculations.
Diffraction on square with no color specified:
Diffraction on curved rhombus in yellow:
Diffraction on triangle in fancy style: