Help detection program

it is positioned in corner of a room and sweep of 45 degrees.

The code to do that looks like?