The needle lies across the nearest line if and only if x \le \frac{\ell \cos \theta}{2} . We see this condition from the right triangle formed by the needle, the nearest line, and the line of length x when the needle lies across the nearest line.
