# Analytical Solution for the Problem of Point Location in Arbitrary Planar Domains
## 3 Base Approach and Related Theorems  
The relative location of a point in a polygon, or actually any other form of closed contour in the plane, can be explored by the results provided by the theorem of Residue and the theorem of Cauchy, which are introduced next. **Theorem 1** (Residue Theorem): _If \(\Gamma\) is a closed curve of the plane, and \(f(z)\) is an analytic function in the domain \(R(\Gamma)\) enclosed by \(\Gamma\) (included), except in a finite number of points inside \(R\), then:_  
\[\oint\limits_{\Gamma}f(z)\,\mathrm{d}z=2\pi\mathrm{j}\sum_{k}r_{k} \tag{2}\]  
_being \(r_{k}\) the residues of \(f(z)\) at the singular points inside \(R\) (being \(\mathrm{j}=\sqrt{-1}\))._  
The residue \(r\) of a complex function \(f(z)\) at a point \(a\), which is a pole of order \(n\) of \(f\), is calculated by \(r=\frac{1}{(n-1)! }\lim\limits_{z\to 4}\frac{\mathrm{d}^{n-1}}{\mathrm{d}z^{n-1} }[(z-a)^{n}f(z)]\). A complex function is analytic on a region \(R\) if it is complex differentiable at every point in \(R\). A common alternative designation is \"holomorphic function\", usually the preferable variant by some mathematicians. Another important fact is given by the Cauchy theorem (or Cauchy-Goursat theorem, since [PERSON] (1858-1936) proved this theorem without imposing the condition that \(f^{\prime}(z)\) should be continuous inside \(R(\Gamma)\) and on the boundary, which was an additional condition left by [PERSON] [26]) that states the following:  
**Theorem 2** (Cauchy-Goursat Theorem). : _If \(R(\Gamma)\) is a simply or multiply connected region whose boundary \(\Gamma\) is sectionally smooth, and if \(f(z)\) is analytic in \(R(\Gamma)\), then the following result applies:_  
\[\oint\limits_{\Gamma}f(z)\,\mathrm{d}z=0. \tag{3}\]  
The previous statement is actually the formalization of the common expression, which states that a line integral of any analytic function is independent of the path. So, the advantage here is to use non-analytic functions on the regions of interest. After selecting a function that is non-defined in only one point inside \(R(\Gamma)\), and whose residue is non-null on that point, by using the Residue and Cauchy theorems, the following reasoning can be engaged:  
\[f(z)\text{ is analytic inside }\Gamma\Rightarrow\oint\limits_{\Gamma}f(z)\, \mathrm{d}z=0 \tag{4}\]  
or, conversely:  
\[\oint\limits_{\Gamma}f(z)\,\mathrm{d}z\
eq 0\Rightarrow f(z)\text{ is not analytic inside }\Gamma. \tag{5}\]  
Asserting that \(f(z)\) is not analytic inside \(\Gamma\) means that \(f(z)\) has at least one discontinuity inside \(\Gamma\). Consequently, and being aware that \(a\) is the unique pole (discontinuity) of \(f(z)\) in \(R(\Gamma)\), i.e., the unique point where it is not defined, a function such as \(f(z)=\frac{1}{z-a}\) allows us to state this final and most valuable conclusion: if the contour integral of \(f(z)\) along a given contour \(\Gamma\) is not null, then its pole lies in the region delimited by that contour, or, in mathematical terms:  
\[\left\{ \begin{array}{l}a\text{ is the pole of }f(z)\\ \oint\limits_{\Gamma}f(z)\,\mathrm{d}z\
eq 0\end{array} \right.\Leftrightarrow a \in R(\Gamma). \tag{6}\]  
It is now necessary to draw some considerations to select an appropriate function and the procedures to apply and take advantage of the previous result. Let a boundary \(\Gamma\) be decomposed in \(M\) parts \(\Omega_{k}\) with \(1\leqslant k\leqslant M\). After reminding ourselves that a contour integral is no more than a line integral where the integration path is a closed curve, the following is clear:  
\[\oint\limits_{\Gamma}f(z)\,\mathrm{d}z=\sum\limits_{i=1}^{M}\int\limits_{ \Omega_{i}}f(z)\,\mathrm{d}z\,. \tag{7}\]  
Although other possibilities exist, we can adopt for \(f(z)\) the one suggested earlier and presented in (8):  
\[f(z)=\frac{1}{z-a}. \tag{8}\]  
The residue of \(f(z)\) at pole \(a\) has the value \(1\).