Drag the lens (or tap where you want it). With a bright source switched on, drag the source to move it behind the lens.
General relativity says light passing a mass is bent towards it. A ray that passes the lens at an angle θ from its centre is bent by an amount proportional to 1/θ, so the light from a background point at true position β reaches us from the direction θ given by the lens equation β = θ − θE²/θ. The Einstein radius θE sets the strength: θE² = (4GM/c²) · DLS/(DL DS), where M is the lens mass and the D's are the distances to the lens, to the source and between them.
The picture is made by working backwards: for every pixel θ of the view the page computes β with the lens equation and copies the colour of the background at β. Lensing does not change surface brightness, so a patch of sky that is stretched to a larger area looks brighter overall: that is the magnification. A point source at distance u (in Einstein radii) from the lens has two images, one outside the ring on the same side and one inside on the opposite side, with magnifications μ = (u² + 2) / (2u√(u² + 4)) ± ½. When source and lens line up exactly (u = 0) the images merge into a ring of radius θE, the Einstein ring.
For a galaxy of about 10¹² solar masses halfway to a distant quasar, θE is one to two arcseconds, which is what the Hubble Space Telescope sees in strong lenses. A star in our Galaxy lensing a more distant star gives θE of about a milliarcsecond: the images cannot be separated, but the brightening (microlensing) is easy to measure and is used to find planets. This demo uses a single point mass and the thin-lens, weak-field approximation; real galaxies are extended and give arcs, crosses and partial rings. The scale here is in screen pixels, not arcseconds.