Is point inside polygon?
<p>I need to write a function that will calculate if a point is inside polygon (true/false).
Polygon always contains 4 points. I'm reading polygons and points from SVG file</p>
<pre><code>&lt;g id=&quot;polygons&quot;&gt;
    &lt;g id=&quot;LWPOLYLINE_183_&quot;&gt;
        &lt;polyline class=&quot;st10&quot; points=&quot;37.067,24.692 36.031,23.795 35.079,24.894 36.11,25.786 37.067,24.692   &quot; /&gt;
    &lt;/g&gt;
    &lt;g id=&quot;LWPOLYLINE_184_&quot;&gt;
        &lt;polyline class=&quot;st10&quot; points=&quot;35.729,23.8 35.413,23.516 34.625,24.39 34.945,24.67 35.729,23.8   &quot; /&gt;
    &lt;/g&gt;
    &lt;g id=&quot;LWPOLYLINE_185_&quot;&gt;
        &lt;polyline class=&quot;st10&quot; points=&quot;34.483,24.368 33.975,23.925 34.743,23.047 35.209,23.454 34.483,24.368   &quot; /&gt;
    &lt;/g&gt;
    &lt;g id=&quot;LWPOLYLINE_227_&quot;&gt;
        &lt;polyline class=&quot;st10&quot; points=&quot;36.593,22.064 36.009,21.563 35.165,22.57 35.736,23.061 36.593,22.064   &quot; /&gt;
    &lt;/g&gt;
&lt;/g&gt;
&lt;g id=&quot;numbers&quot;&gt;
    &lt;g id=&quot;TEXT_1647_&quot;&gt;
        &lt;text transform=&quot;matrix(0.7 0 0 1 34.5876 23.8689)&quot; class=&quot;st12 st2 st13&quot;&gt;169&lt;/text&gt;
    &lt;/g&gt;
    &lt;g id=&quot;TEXT_1646_&quot;&gt;
        &lt;text transform=&quot;matrix(0.7 0 0 1 35.1049 24.1273)&quot; class=&quot;st12 st2 st13&quot;&gt;168&lt;/text&gt;
    &lt;/g&gt;
    &lt;g id=&quot;TEXT_1645_&quot;&gt;
        &lt;text transform=&quot;matrix(0.7 0 0 1 35.924 24.7302)&quot; class=&quot;st12 st2 st13&quot;&gt;167&lt;/text&gt;
    &lt;/g&gt;
    &lt;g id=&quot;TEXT_1643_&quot;&gt;
        &lt;text transform=&quot;matrix(0.7 0 0 1 36.0102 22.4477)&quot; class=&quot;st12 st2 st13&quot;&gt;174&lt;/text&gt;
    &lt;/g&gt;
&lt;/g&gt;
</code></pre>
<p>So for polyline it would be the first 4 sets of coordinates and for text X and Y are last 2 numbers in matrix brackets. Also don't know if that point for text is the center of text or bottom left corner (suppose it's this).</p>
<p>So far I got all coordinates for points and polygons in lists so I'm cross checking that way.</p>