code: public static Point2D findIntersection(final int x, final int y, final MultiPath path)
      {
          final Point2D pointerPosition = new Point2D(x, y);
  
          final BoundingBox box = path.getBoundingBox();
  
          final Point2D center = findCenter(box);
  
          // length just needs to ensure the c to xy is outside of the path
          final double length = box.getWidth() + box.getHeight();
  
          final Point2D projectionPoint = getProjection(center, pointerPosition, length);
  
          final Point2DArray points = new Point2DArray();
  
          points.push(center);
  
          points.push(projectionPoint);
  
          final Set<Point2D>[] intersects = Geometry.getCardinalIntersects(path, points);
  
          Point2D nearest = null;
  
          for (final Set<Point2D> set : intersects)
          {
              double nearesstDistance = length;
  
              if ((set != null) && !set.isEmpty())
              {
                  for (final Point2D p : set)
                  {
                      final double currentDistance = p.distance(pointerPosition);
  
                      if (currentDistance < nearesstDistance)
                      {
                          nearesstDistance = currentDistance;
  
                          nearest = p;
                      }
                  }
              }
          }
          return nearest;
      }
docs: Finds intersecting point from the center of a path
  @param x
  @param y
  @param path
  @return the path's intersection point, or null if there's no intersection point