# Optical cavity

Contributor: Stas Fainer

This is a simulation of optical rays inside an optical cavity. In general, given the length of the optical cavity is $$d$$, and the focal length of its ideal mirrors is $$f$$, the optical cavity is stable (meaning that for each ray that emanates from one of the mirrors towards the other mirror, a non-divergent trajectory is guaranteed for sufficiently high mirrors) in the paraxial approximation, if and only if $$d\leq 4f$$.