title: How to check if a circle lies inside of convex polygon
body: <p>I would like to check if a circle intersects or lies inside a convex polygon. I found a brilliant method to detect if a point is inside a polygon (from <a href="http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html" rel="noreferrer">here</a>):</p>
  
  <pre><code>        public boolean insidePolygon(Vector2 [] vertices, Vector2 p)
          {
              int i, j;
              boolean c = false;
              int nvert = vertices.length;
              for (i = 0, j = nvert - 1; i &lt; nvert; j = i++)
              {
                  if (((vertices[i].Y &gt; p.Y) != (vertices[j].Y &gt; p.Y)) &amp;&amp;
                   (p.X &lt; (vertices[j].X - vertices[i].X) * (p.Y - vertices[i].Y) / (vertices[j].Y - vertices[i].Y) + vertices[i].X))
                      c = !c;
              }
              return c;
          }
  </code></pre>
  
  <p>And this works perfectly for a single point, but is there any way we could modify this to check if a circle with a given radius is inside a polygon? I suppose it's possible because a circle is actually a point but bigger, but still I haven't managed to succeed...</p>