user266751
user266751

Reputation: 51

Java Implementation of Rectangle Intersection Algorithm..?

I am interested in this algorithm: Algorithm to detect intersection of two rectangles?

but unable to implement it myself lacking even basic mathematical skills. I think I could understand it better once I can read the code. Does somebody perhaps have already an implementation or can quickly write one?

Thanks!

Upvotes: 3

Views: 5053

Answers (1)

randomguy
randomguy

Reputation: 12242

If you're using Java, all implementations of the Shape interface have an intersects method that take a rectangle.

from Algorithm to detect intersection of two rectangles?

Java doc

Upvotes: 2

Related Questions