Hi,
I need to define a function in 2D as follows:
f(x) = \begin{cases} 1 \qquad if \qquad dist(x,boundary) \leq 0.5 \\ 0 \qquad if \qquad dist(x,boundary)>0.5\end{cases}
Is there an elegant way to do this, besides calculating the distance of x to all the boundary points and minimizing it for checking the conditions?