79825187

Date: 2025-11-20 07:10:41
Score: 1
Natty:
Report link

You forgot an imaginary unit in exponential function:

return np.cos(np.pi*u/w) * np.sin(alpha*u)*np.exp(2*np.pi*1j*x*u/(wavelength*f))

Now you can get a pretty figure

import matplotlib.pyplot as plt
plt.imshow(I)
plt.colorbar()
plt.show()

difraction pattern

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: qrspeter