Let theta be the angle of the point's initial vector. After traveling a
distance r, the point has moved r*cos(theta) horizontally and r*sin(theta)
vertically, and thus has struck r*(sin(theta)+cos(theta))+O(1) walls. Hence
the average distance between walls will be 1/(sin(theta)+cos(theta)). We now
- average this over all angles theta
- 2/pi * intg from theta=0 to pi/2 (1/(sin(theta)+cos(theta))) dtheta
which (in a computation which is left as an exercise) reduces to
2*sqrt(2)*ln(1+sqrt(2))/pi = 0.793515.