Still stuck in my old ways aren't I.
Here's the distribution of endpoints using your sampling procedure.
https://plot.ly/~compwiztobe/9/
Code:
from random import random
from math import pi,cos,sin,sqrt
import numpy
def randseg():
hl=random()/sqrt(2)
th=random()*pi
cx=random()
cy=random()
return [cx-hl*cos(th),cx+hl*cos(th),cy-hl*sin(th),cy+hl*sin(th)]
def inbox(seg):
return(all([x>=0 and x<=1 for x in seg]))
def go(n):
l=[]
for i in range(n):
x=randseg()
if inbox(x):
l.append(x)
return(l)
def pts(l):
p=[]
for x in l:
p.append([x[0],x[2]])
p.append([x[1],x[3]])
return(p)
data=pts(go(1000000))
#then bin and plot 2d histrogram with plotly API
Curious about an analytical form, but this at least shows the idea. The way we solved the problem before assumed this plot was all one color.