code: private static Collision collide(Origin origin,
                                       FeatureProvider provider,
                                       Transformable transformable,
                                       Collidable other,
                                       Collision collision,
                                       Rectangle rectangle)
      {
          final Mirror mirror = getMirror(provider, collision);
          final int offsetX = getOffsetX(collision, mirror);
          final int offsetY = getOffsetY(collision, mirror);
  
          final double sh = origin.getX(transformable.getOldX() + offsetX, rectangle.getWidthReal());
          final double sv = origin.getY(transformable.getOldY() + offsetY, rectangle.getHeightReal());
          final double dh = origin.getX(transformable.getX() + offsetX, rectangle.getWidthReal()) - sh;
          final double dv = origin.getY(transformable.getY() + offsetY, rectangle.getHeightReal()) - sv;
          final double norm = Math.sqrt(dh * dh + dv * dv);
          final double sx;
          final double sy;
          if (Double.compare(norm, 0.0) == 0)
          {
              sx = 0;
              sy = 0;
          }
          else
          {
              sx = dh / norm;
              sy = dv / norm;
          }
  
          final double oldX = rectangle.getX();
          final double oldY = rectangle.getY();
          for (int count = 0; count <= norm; count++)
          {
              if (checkCollide(rectangle, other))
              {
                  return collision;
              }
              rectangle.translate(sx, sy);
          }
          rectangle.set(oldX, oldY, rectangle.getWidth(), rectangle.getHeight());
          return null;
      }
docs: Check if other collides with collision and its rectangle area.
  
  @param origin The origin used.
  @param provider The provider owner.
  @param transformable The transformable owner.
  @param other The other collidable to check.
  @param collision The collision to check with.
  @param rectangle The collision rectangle.
  @return The collision collides with other, <code>null</code> if none.