android - 如何判断两条线段是否相交

浏览:40日期:2022-11-05

问题描述

RT,两条曲线都是由触发的点连接的贝塞尔曲线。求,如何判断两个贝塞尔曲线是否是相交的,求指教。

提了好久都没有人来答,那现在问题改简单一下,看看有什么好答案。那么要如何判断两条直线段是否相交呢?

问题解答

回答1:

Using the available classes from the 2D Graphics API.

Rectangle r1 = new Rectangle(100, 100, 100, 100); Line2D l1 = newLine2D.Float(0, 200, 200, 0); System.out.println('l1.intsects(r1) = ' + l1.intersects(r1));

传送门: 1. How to check intersection between a line and a rectangle?2. How do you detect where two line segments intersect?

相关文章: