1
我有多邊形和一條線。由線交叉的多邊形
g.drawLine(this.getLine().getP1().getX(), this.getLine().getP1().getY(),
this.getLine().getP2().getX(), this.getLine().getP2().getY());
g.drawPolygon(this.polygon);
我必須找到多邊形和直線(如果有的話)之間的交叉點,以及直線的哪一部分在多邊形中。任何想法如何做到這一點。
這是一個編程問題? – michael667
@ michael667 - 聽起來更像是一個解析幾何問題。 – mcfinnigan
可能的重複:http://stackoverflow.com/questions/3940694/line-clipping-to-arbitary-2d-polygon#3944295 –