Compute intersection with box in toroidal domain

18 Views Asked by At

Consider the box $[0, 1)^d$ with wrap around; for example, $1 + .05 = .05$ in each dimension.

Given a point $x\in[0,1)^d$ and a positive constant $\epsilon$ (between $0$ and $.5$), I want to obtain a vector of all "boxes" inside $[0, 1)^d$ which arise by wrapping around the box with minimum corner $x - (\epsilon,\ldots,\epsilon)$ and maximum corner $x + (\epsilon,\ldots, \epsilon)$.

I think a picture helps a lot; here is the case $d = 2$:

enter image description here

The box can be described a point $p\in\mathbb R^d$ and a length vector $u\in(0,\infty)^d$. The box is then given by $B:=[p,p+u)$. You can assume that $$|B\cap[0,1)^d|>1$$ (i.e. the intersection is nontrivial).