Diffraction & Interference API
Wave-optics diffraction and interference as an API, computed locally and deterministically. The double-slit endpoint applies Young's two-slit interference, d·sinθ = m·λ: from a wavelength and the slit separation it returns the angle of the m-th bright fringe and, given the screen distance, the fringe spacing Δy = λ·L/d and the position of any maximum — the classic experiment that proved light is a wave. The grating endpoint handles a diffraction grating, d·sinθ = m·λ with d = 1/lines: from a wavelength and the grating density (lines per millimetre) it gives the diffraction angle of each order and the maximum observable order ⌊d/λ⌋, flagging orders that do not exist. The single-slit endpoint computes single-slit diffraction, a·sinθ = m·λ for the dark fringes (minima), and, given the screen distance, the width of the bright central maximum 2·λ·L/a. Wavelengths may be entered in metres, nanometres or micrometres. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and optics-education tools, spectroscopy and grating design, laser and photonics apps, and laboratory software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is wave-optics diffraction; for thin-lens imaging use a lens API and for Snell's-law refraction use a Snell API.
api.oanor.com/diffraction-api