Are there any known examples of analytic, globally continuous functions $f(x,y): (x,y)\in\mathbb{R}\times\mathbb{R}\rightarrow\mathbb{R}$ such that  

$$f(x,y)\lt 0\Leftrightarrow (x,y)\not\in\mathcal{P}$$
$$f(x,y)=0\Leftrightarrow (x,y)\in\partial\mathcal{P}$$
$$f(x,y)\gt 0\Leftrightarrow (x,y)\in\mathcal{P} \setminus\partial\mathcal{P}$$


where $\mathcal{P}$ is a connected region, whose boundary $\partial\mathcal{P}$ is a finite collection of disjoint simple polygons? 


Without the requirement, that $f(x,y)$ has different sign inside and outside of $\mathcal{P}$, examples of such functions can be easily defined with $\sqrt{(x+\frac{l}{2})^2+y^2}+\sqrt{(x-\frac{l}{2})^2+y^2}-l)$ which serve as models for factors that vanish on a line segment of length $l$, but nowhere else 


In view of the example that apparently isn't analytic, I have repeated the requirement that $f(x,y)$ be analytic and added the requirement, that it be globally continuous. 


**Remark:**  

The functions I am looking for with the relaxed condition of being $C^\infty$, zero on $\partial P$ and, positive in $P\setminus\partial P$ could also be used as testfunctions (cf e.g. <http://en.wikipedia.org/wiki/Distribution_%28mathematics%29> ) for generalized functions on polygonal domains.



Examples of Bivariate Analytic, Globally Continuous Functions, whose Set of Zeros are Boundaries of Polygons
OK, here is a proof (mimic one-variable complex calculus). Assume that a power series $f(x,y)=\sum a\_{ij}x^iy^j$ vanishes on $y=0$, $-\epsilon<x\le0$. Then, as usual, $i!a\_{i0}=\partial^if/\partial x^i(0,0)=0$. (As we assume that the partial derivatives exist, we can use negative values to compute them.) But then $f(x,0)=0$ for all $x$, hence $f$ vanishes on the whole line $y=0$. Thus, you cannot have zero locus made out of line segments that are not whole lines.


