Pencils of rays in wave optics