# Analytical Solution for the Problem of Point Location in Arbitrary Planar Domains
## 6 NRA Crossing and Sense for Circular Arcs
### Parametric Expression for Circular Arcs  
Any point of a circular arc with center at \(z_{0}\), and evolving in the positive sense (counter-clockwise--\(CCW\)), between point \(z_{1}=z_{0}+re^{\mathrm{i}\theta_{1}}\) and point \(z_{2}=z_{0}+re^{\mathrm{i}\theta_{2}}\) is expressed by \(z=z_{0}+re^{\mathrm{i}\theta}\), where \(\theta\) covers the interval defined by \(\theta_{1}\) and \(\theta_{2}\), and \(r=|z_{0}-z_{1}|=|z_{0}-z_{2}|\). To simplify the parametrization and unify the procedures used for the linear segment, the following parametric representation is used:  
Figure 12: Example of points tested in a 2216-side polygon: 5000 random on the left and more than 2200 random points very close to the borders on the right. As indicated at the top of each image, Algorithm 3 ran about 5 times faster than the state-of-the-art (SOTA) Matlab’s native algorithm [8]. Tested in a HP ZBook Fury 15 with Intel Core i7-10750H CPU 2.60 GHz with 32 GBytes of RAM in Ubuntu Linux 22.04.3. Figure 13: Examples of arc segments with center in \(z_{0}\) starting on point \(z_{1}\) and ending at point \(z_{2}\). Depending on \(z_{0}\), the very same arc can intersect the negative real axis (NRA), zero times, once (\(I_{1}\)), twice (\(I_{1}\) and \(I_{2}\)), or be tangent (\(I_{1}\equiv I_{2}\)), which, for the purposes of path integral evaluation, is equivalent to intersect the NRA twice, in opposite senses. \[z=z_{0}+r\mathrm{e}^{\left|\theta_{1}+(\theta_{2}-\theta_{1})\right|},0\leq t \leq 1. \tag{50}\]  
However, to ensure an unambiguous interpretation of the path described for the positive sense, it must be \(\theta_{1}\leq\theta_{2}\) where it is expected that the angles are obtained by the following operations: \(\theta_{1}=\arg(z_{1}-z_{0})\) and \(\theta_{2}=\arg(z_{2}-z_{0})\). But if that is not the case, then one of the angles must be converted by modulus \(2\pi\), that is, force \(\theta_{1}\) and \(\theta_{2}\) to fall in the interval \(]-2\pi,+2\pi]\), by applying either \(\theta_{2}\leftarrow\theta_{2}+2\pi\) or \(\theta_{1}\leftarrow\theta_{1}-2\pi\), depending on the necessary case. All the situations in Figure 13 respect the proper condition, \(\theta_{1}\leq\theta\leq\theta_{2}\), but different situations are illustrated in Figure 14 where \(\theta\) encounters a discontinuity if restricted to the interval \(]-\pi,+\pi]\). As the figure explains, in one case the solution for a proper parametrization is to convert \(\theta_{2}\) into \(\theta_{2}+2\pi\) and the other to convert \(\theta_{1}\) into \(\theta_{1}-2\pi\). On the other hand, if a negative (or clockwise, \(CW\)) sense is intended, an equivalent operation must be taken into account, as illustrated in Figure 15.  
In summary, to ensure the proper and unambiguous parametrization of a circular segment, the following steps have to be carried out when defining a circular boundary segment:  
* Indicate \(z_{1},z_{2}\), and the center \(z_{0}\) (or some other means to obtain \(z_{0}\), like a third point \(z_{p}\), or a radius and the relative placement of the center);
* Obtain \(\theta_{1}=\arg(z_{1}-z_{0})\) and \(\theta_{2}=\arg(z_{2}-z_{0})\);
* Define circulation sense (\(CCW\) or \(CW\));
* Check the potential angle adjustments given by (51):\[\begin{cases}\theta_{2}\leq\theta_{1}\wedge CCW& \begin{cases}\theta_{2}<0&\Rightarrow \theta_{2}\leftarrow\theta_{2}+2\pi\\ \theta_{2}\geq 0&\Rightarrow\theta_{1}\leftarrow\theta_{1}-2\pi\\ \theta_{1}\leq\theta_{2}\wedge CW&\begin{cases}\theta_{1}<0&\Rightarrow \theta_{1}\leftarrow\theta_{1}+2\pi\\ \theta_{1}\geq 0&\Rightarrow\theta_{2}\leftarrow\theta_{2}-2\pi\end{cases}. \end{cases}  \tag{51}\]  
In expression (51), the verification of the equality between \(\theta_{1}\) and \(\theta_{2}\) is also considered to include the situation of complete circles (where \(\theta_{1}\) and \(\theta_{2}\) would coincide, but actually one of them should be \(2\pi\) larger than the other to ensure that the possibility of a full circle is covered).