矩形交集算法的Java实现..?

发布于 2024-09-18 15:40:52 字数 220 浏览 2 评论 0原文

我对此算法感兴趣:检测两个矩形相交的算法?

但我自己无法实现它,甚至缺乏基本的数学技能。我想一旦我能阅读代码我就能更好地理解它。有人可能已经实现了或者可以快速编写一个吗?

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的鱼塘能养鲲 2024-09-25 15:40:52

如果您使用 Java,则所有
Shape 接口的实现
有一个 intersects 方法,采用
矩形。

来自 检测两个矩形相交的算法?

< a href="http://download.oracle.com/javase/6/docs/api/java/awt/Shape.html#intersects(double,%20double,%20double,%20double)" rel="nofollow noreferrer" >Java文档

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文