Finds the approximate boundary of the upper and lower edges of the beam expressed as a slope. We then skip the relatively expensive intcode test if the x and y coordinates lie outside.