distance between rects

Started by
1 comment, last by Will F 18 years, 4 months ago
what is the best / fastest way to find the distance between two rectangles?
Advertisement
Depends on your definition of this "distance" and whether your rectangles can be rotated or not.
A quick way is simply calculating the distance between their centres. This distance will stay the same even for arbitrary oriented rects.

Quote:Original post by darookie
A quick way is simply calculating the distance between their centres. This distance will stay the same even for arbitrary oriented rects.


You can use the pythagorean theorem to do this.

This topic is closed to new replies.

Advertisement