Given the following TikZ picture with an irregularly shaped polygon:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path[draw=blue] (0,3) -- (5,4) -- (3,2) -- (4,0) -- (1,1) -- cycle;
\node [circle,draw=none,fill=green,inner sep=0pt,minimum size=0.3cm] at (3.5,0.4) {};
\node [circle,draw=none,fill=green,inner sep=0pt,minimum size=0.3cm] at (1.03,1.3) {};
\node [circle,draw=none,fill=red,inner sep=0pt,minimum size=0.3cm] at (3.3,2) {};
\node [circle,draw=none,fill=red,inner sep=0pt,minimum size=0.3cm] at (0.7,1.8) {};
\end{tikzpicture}
\end{document}
The two green circles in the picture lie completely inside the polygon, while the red ones lie partially or fully outside. Is there a way to automate that "ownership" test in TikZ? I know algorithms exist for such kind of tests, but does TikZ already provide this or similar features (e.g. tests for single points)?



even odd rule(section 15.5.2 of the manual) to test this. Of this would almost certainly be subject to rounding errors. – Dec 26 '18 at 07:20