.NET Ascertaining mouse is on line drawn between two arbitrary points
- by johnc
I have an arrow drawn between two objects on a Winform.
What would be the simplest way to determine that my mouse is currently hovering over, or near, this line.
I have considered testing whether the mouse point intersects a square defined and extrapolated by the two points, however this would only be feasible if the two points had very similar x or y values.
I am thinking, also, this problem is probably more in the realms of linear algebra rather than simple trigonometry, and whilst I do remember the simpler aspects of matrices, this problem is beyond my knowledge of linear algebra.
On the other hand, if a .NET library can cope with the function, even better.