This is a collection of simple programs that I created to learn about JavaScript.

### 2D Chebyshev Polynomials Generator

Chebyshev polynomials are often used to represent the wavefront error of optical elements what have an X or Y symmetry, like cylindrical lenses and mirrors.
This program calculates and displays the 2D Chebyshev polynomials defined over a circular domain.

### Zernike Polynomials Generator

Zernike polynomials are often used to represent the wavefront error of optical systems. This script calculates the polynomials ordered with the Noll index.
This program calculates and displays the Zernike polynomials ordered by Noll index.

### Holographic Lens Simulator

I modelled a holographic lens as a pure phase object that reimages a point source at (0, 0, -200) into (0, 0, 200) with a numerical aperture of 0.005. This approach doesn't take into account multiple diffraction orders, although it is an easy functionality to add. The sliders allow to add some amount of wavefront error. Note that the Zernike terms are numbered with the Noll index. It is also possible to move the detector along the Z direction from the lens plane (Z = 0) to Z = 400.
This program calculates the spot diagram generated by a holographic lens with customized aberrations for a point source.

### Holographic Lens Field Aberrations

I modelled a holographic lens as a pure phase object that reimages a point source at (0, 0, -200) into (0, 0, 200) with a numerical aperture ranging from 0.1 to 0.9. This program shows the spot diagram generated by a point source located at (X, Y, -200). When X and Y are not equal to 0, the field dependent aberrations distort the spot diagram. The program also shows a zoomed version of the spot diagram with the RMS radius of the raytraced spot.
This program calculates the spot diagram generated by a holographic lens for a point source located in different field positions.