code: public static int crossQuad (float x1, float y1, float cx, float cy, float x2, float y2,
                                   float x, float y) {
          // LEFT/RIGHT/UP/EMPTY
          if ((x < x1 && x < cx && x < x2) || (x > x1 && x > cx && x > x2)
                  || (y > y1 && y > cy && y > y2) || (x1 == cx && cx == x2)) {
              return 0;
          }
  
          // DOWN
          if (y < y1 && y < cy && y < y2 && x != x1 && x != x2) {
              if (x1 < x2) {
                  return x1 < x && x < x2 ? 1 : 0;
              }
              return x2 < x && x < x1 ? -1 : 0;
          }
  
          // INSIDE
          QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
          float px = x - x1, py = y - y1;
          float[] res = new float[3];
          int rc = c.solvePoint(res, px);
          return c.cross(res, rc, py, py);
      }
docs: Returns how many times ray from point (x,y) cross quard curve