Calculation of intersections between line segments

前端 未结 3 1278
慢半拍i
慢半拍i 2020-12-05 03:11

There\'s a lot of questions about intersections between line segments here at stackowerflow and here is one more! Sorry, but I need help to understand how to calculate inter

3条回答
  •  时光说笑
    2020-12-05 03:56

    public void fixData()
    {
        slope = (p2.getY() - p1.getY()) / (p2.getX() - p1.getX());
        yInt = p1.getY() - slope * p1.getX();
        xInt = (-yInt) / slope;
    }
    

提交回复
热议问题