jjzjj

c# - 如何知道一条线是否与矩形相交

我已经检查过这个问题,但答案对我来说非常大:HowtoknowifalineintersectsaplaneinC#?-Basic2Dgeometry是否有任何.NET方法可以知道由两点定义的线是否与矩形相交?publicboolIntersects(Pointa,Pointb,Rectangler){//returntrueifthelineintersectstherectangle//falseotherwise}提前致谢。 最佳答案 publicstaticboolLineIntersectsRect(Pointp1,Poi