# Analytical Solution for the Problem of Point Location in Arbitrary Planar Domains
## 7 Application to Bezier Curves
For each root that satisfies the previous expression there is a NRA intersection whose sense needs to be assessed by the sign of \(\frac{\mathrm{d}y_{B_{3}}}{\mathrm{d}t}=30t^{2}-30t+6\). Table 2 shows some numerical results that illustrate the functionality of the algorithm for a cubic Bezier segment for two test points \(a_{1}\) and \(a_{2}\). Figures 17 and 18 illustrate the plots concerning NRA intersections by the cubic Bezier segment for the cases of point \(a_{1}\) and \(a_{2}\), respectively. The intersection contributions \(I_{C}\) (detailed in Table 2) clearly translate the situations of inclusion of the tested points. For \(a_{1}\), total \(I_{C}\) is \(-1\) and for \(a_{2}\) total \(I_{C}\) is \(+1-1=0\). Actually, the \(I_{C}\) contributions from the two linear segments were not analyzed, but it is simple to confirm that they do not contribute at all because they do not cross the NRA: the  
Figure 16: Region delimited by a cubic Bézier and two linear segments. Points \(z_{1}\) and \(z_{2}\) (not plotted in the figure) are the Bézier control points. horizontal segment will never contribute, and the vertical segment does not cross the NRA for the points being tested. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Testing Points** & \(\mathbf{t_{i}}\) & \(\mathbf{x_{B_{\text{2}}}(t_{i})}\) & \(\mathbf{\downarrow t_{0}}\) & \(\frac{\mathbf{\mathrm{d}}\mathbf{y_{\text{2}}}}{\mathbf{\mathrm{d}}t}(t_{i})\) & \(\mathbf{I_{C}}\) & \(\sum\mathbf{I_{C}}\) \\ \hline \multirow{3}{*}{\(a_{1}\)} & \(t_{1}=0.1517\) & \(-0.2379\) & yes & \(2.139\) & \(-1\) & \\  & \(t_{2}=0.4312\) & \(0.0974\) & no & \(-1.358\) & \(0\) & \(-1\) \\  & \(t_{3}=0.9171\) & \(0.6805\) & no & \(3.719\) & \(0\) & \\ \hline \multirow{3}{*}{\(a_{2}\)} & \(t_{1}=0.0829\) & \(-0.6805\) & yes & \(3.719\) & \(-1\) & \\  & \(t_{2}=0.5688\) & \(-0.0974\) & yes & \(-1.358\) & \(+1\) & \(0\) \\  & \(t_{3}=0.8483\) & \(0.2379\) & no & \(2.139\) & \(0\) & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Detailed analysis of operations concerned with NRA crossings by a cubic Bézier segment for two testing points in the case illustrated in Figures 16–18. Figure 17: Bézier real axis intersections for testing point \(a_{1}\). The “\(\ast\)” are the points where the curve intersects the horizontal axis, the green circle represents the point being tested when shifted to the system origin, and the square indicates a NRA crossing that effectively contributes to the intersection counting. Check Table 2 for more details. Figure 18: Bézier real axis intersections for testing point \(a_{2}\). The “\(\ast\)” are the points where the curve intersects the horizontal axis, the green circle represents the point being tested when shifted to the system origin, and the squares indicate a NRA crossing that effectively contributes to the intersection counting. Check Table 2 for more details. With higher order curves, such as these 3 rd order Bezier, it may happen that the intersection point is tangent to the NRA and expression (43) would result in 0 (inconclusive). This is an easy situation to detect (one further comparison) and concerns a case where all three roots \(t_{c}\) are equal. There are two solutions for that very special case to allow the detection of the intersection sense: one would be to calculate expression (43) in a \"small\" neighborhood of \(t_{c}\), for example, \(t_{c}-\delta\) instead of \(t_{c}\) (where the value of \(\delta\) can be on the range of the precision involved--e.g., \(10^{-6}\)); the other solution, formally more elegant, is simply to check the quadrants of \(z_{1}\) and \(z_{2}\), i.e., use the value of \(\operatorname{sgn}(y_{1}-y_{2})=\operatorname{sgn}(\Delta Y_{b})\).