def criss_cross?(other)
      # case 1: this one is horizontal:
      # overlaps other by x, to right and left, and goes inside it by y
      @x0 < other.x0 && @x1 > other.x1 &&
        @y0 > other.y0 && @y1 < other.y1 ||
        # case 2: this one is vertical:
        # overlaps other by y, to top and bottom, and goes inside it by x
        @y0 < other.y0 && @y1 > other.y1 &&
          @x0 > other.x0 && @x1 < other.x1
    end
def criss_cross?(other)
      # case 1: this one is horizontal:
      # overlaps other by x, to right and left, and goes inside it by y
      @x0 < other.x0 && @x1 > other.x1 &&
        @y0 > other.y0 && @y1 < other.y1 ||
        # case 2: this one is vertical:
        # overlaps other by y, to top and bottom, and goes inside it by x
        @y0 < other.y0 && @y1 > other.y1 &&
          @x0 > other.x0 && @x1 < other.x1
    end
rubocop:disable Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity,Metrics/AbcSize