Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个我可以设置的标准,当鼠标的位置不符合它时,无法设置该点。
如何防止在java中绘制凹多边形?
您需要检查多边形的所有点是否都在凸包上。参见例如Graham Scan。它是一个带有构造函数的类,它接受一个Point2D对象数组。一个方法hull()返回一个Iterable<Point2D>. 对于多边形的每个新候选点,此迭代必须包含您的新点。
Point2D
hull()
Iterable<Point2D>