Thank you Preben, but I have this answer.
I would not offend Kitonum (who posted a pretty solution) but the "other" was smarter.
In fact I think I rediscoverd it by myself (thanks to my anonymous inspirer) :
- Let A a fixed real interval
- let B another real interval and B(x) a translation of B of value x
- Question : "Do A and B(X) overlap ?"
(A) solution :
coverage := proc(A, B, x)
coulditbe('_u', `intersect`(SetOf(A), SetOf(map(y -> x+y, B)) ) )
# example :
A := RealRange(0, 2);
B := RealRange(-3, -1);
coverage(A, B, 0.999):
coverage(A, B, 1.001):
No offence meant to Kitonum, and without regard of efficiency, this solution is slightly more aesthetic than the one he proposed to me :-)