I would like to find a way to know if I click on a line. I have a standard 2D plan with square for example and a line between both. I would like to detect when I click on the line. The line can be horizontal, vertical or with an angle. I have those information on the line :
-Starting coordinate (x,y)
-Ending coordinate (x,y)
-The mouse click position (x,y)
I might be able to get the angle with tan(). I found this solution but i can't add mouse event: How to select a line
Thanks you.