title: check if Latlng is inside polygon
body: <p>I'm drawing Polygon on city in order to check if current position is inside this polygon or not, and i'm doing that with below code:- </p>
  
  <pre><code> ArrayList&lt;LatLng&gt; polyLoc = new ArrayList&lt;LatLng&gt;();
  polyLoc.add(new LatLng(24.643932, 46.297718));
      polyLoc.add(new LatLng(24.695098, 46.555897));
      polyLoc.add(new LatLng(24.921971, 46.476246));
      polyLoc.add(new LatLng(25.147185, 46.366383));
      polyLoc.add(new LatLng(25.155886, 47.249409));
      polyLoc.add(new LatLng(24.929444, 47.346913));
      polyLoc.add(new LatLng(24.691355, 47.106587));
      polyLoc.add(new LatLng(24.449060, 47.219197));
      polyLoc.add(new LatLng(24.293947, 46.973377));
      polyLoc.add(new LatLng(24.641436, 46.299092));
  </code></pre>
  
  <p>And i checking if the current position is inside this polygon or not by this way :-</p>
  
  <pre><code>if (hasPermission() &amp;&amp; gpsTracker.canGetLocation()) {
          if (isPointInPolygon(new LatLng(gpsTracker.getLatitude(), gpsTracker.getLongitude()), polyLoc)) {
              cash.setVisibility(View.VISIBLE);
              cashIcon.setVisibility(View.VISIBLE);
          } else {
              cash.setVisibility(View.GONE);
              cashIcon.setVisibility(View.GONE);
          }
          Log.d(TAG, "reservationDialog: " + gpsTracker.getLatitude() + gpsTracker.getLongitude());
      }
  </code></pre>
  
  <p>here is my isPointInPolygon method :</p>
  
  <pre><code>private boolean isPointInPolygon(LatLng tap, ArrayList&lt;LatLng&gt; vertices) {
      int intersectCount = 0;
      for (int j = 0; j &lt; vertices.size() - 1; j++) {
          if (rayCastIntersect(tap, vertices.get(j), vertices.get(j + 1))) {
              intersectCount++;
          }
      }
  
      return ((intersectCount % 2) == 1); // odd = inside, even = outside;
  }
  
  private boolean rayCastIntersect(LatLng tap, LatLng vertA, LatLng vertB) {
  
      double aY = vertA.latitude;
      double bY = vertB.latitude;
      double aX = vertA.longitude;
      double bX = vertB.longitude;
      double pY = tap.latitude;
      double pX = tap.longitude;
  
      if ((aY &gt; pY &amp;&amp; bY &gt; pY) || (aY &lt; pY &amp;&amp; bY &lt; pY)
              || (aX &lt; pX &amp;&amp; bX &lt; pX)) {
          return false; // a and b can't both be above or below pt.y, and a or
          // b must be east of pt.x
      }
  
      double m = (aY - bY) / (aX - bX); // Rise over run
      double bee = (-aX) * m + aY; // y = mx + b
      double x = (pY - bee) / m; // algebra is neat!
  
      return x &gt; pX;
  }
  </code></pre>
  
  <p>I don't know why it's not working, what i'v missed here?</p>