return isPointInPolygon(x, rg);
Geo ray = c.crossNormalize(x);  Geo side = Geo.crossNormalize(x, ray); boolean in = false; Geo p1 = new Geo(poly[0]); Geo p2 = new Geo(poly[0]); for (int i = 1; i < poly.length; i++) { p2.initialize(poly[i]);  if ((p1.dot(ray) < 0.0) != (p2.dot(ray) < 0.0) && p1.intersect(p2, ray).dot(side) > 0.0) in = !in; Geo temp = p1; p1 = p2; p2 = temp; }     if (!p1.equals(poly[0])) { p2.initialize(poly[0]); if ((p1.dot(ray) < 0.0) != (p2.dot(ray) < 0.0) && p1.intersect(p2, ray).dot(side) > 0.0) { in = !in; } }  return in;
    public static boolean isPointInPolygon(Geo x, float[] poly,                                           boolean polyInDegrees) {        Geo[] rg = new Geo[poly.length / 2];        for (int j = 0; j < poly.length / 2; j++) {            rg[j] = new Geo(poly[j * 2], poly[j * 2 + 1], polyInDegrees);        }        return isPointInPolygon(x, rg);    }