Upper-half-plane harmonic measure of the positive half-axis (source code)

= Upper-half-plane harmonic measure of the positive half-axis

For planar <Brownian motion> started at $(x,y)$ with $y>0$, the probability that its first hit of the real axis lies in $(0,\infty)$ is
$$
\frac12+\frac1\pi\arctan\frac{x}{y}
=1-\frac1\pi\arg(x+iy).
$$
This is the bounded <harmonic function> in the upper half-plane with boundary values zero on the negative half-axis and one on the positive half-axis.