How do I find the distance between two 2D squares if I am given x, y, length, and height of two 2D squares?
Current idea I have is to simply brute force it and check the distance from every point in one edge of a square with every point in one edge of the other square and pick the lowest distance of the two. (the edges depending on the location/length of the two squares)
Is there a better way/algorithm for this?
Current idea I have is to simply brute force it and check the distance from every point in one edge of a square with every point in one edge of the other square and pick the lowest distance of the two. (the edges depending on the location/length of the two squares)
Is there a better way/algorithm for this?