Trouble with intersection between line segments

后端 未结 1 1874
醉梦人生
醉梦人生 2021-01-24 02:54

I have a path stored as points in an arraylist and I want to check if the line segments are intersecting. For some unknown reason it\'s not working! I don\'t get any message in

相关标签:
1条回答
  • 2021-01-24 03:09

    You are using int for coordinates and so it does integer division (i.e., 3/2 = 1). This might be the reason when you are dividing by denom. You can fix it by dividing by ((double)denom) instead of simply denom.

    0 讨论(0)
提交回复
热议问题