I'm making a Graph drawing tool in C#/Windows Forms, and to better distinguish parallel edges, I drew curves and circles. I saw, that GraphicsPath have a property for get “all” the points of that curve. Drawing out those points made it clear, that it is very likely using bezier curves to solve the problem, and the points given are the control-points instead, even for a circle—that I draw for loops.
The whole situation matters because for the editor, I would like to make it possible to select the edges by clicking on the lines, and for that I would like to get the distance between the cursor position and edge, so I could determine whether it is close
enough. At first I didn't really know what function it is using to draw the curve—not that it would be a good idea to speculate—however I decided later, to compute the distance using another function for the edge regardless what is drawn. These points are
better, because they don't require derivating, instead I check 6 line segment per edge. This is till not the best though.
I'm not really satisfied with this solution—not to mention that it still not works properly—and would like to ask what do you suggest for curve selecting, or how to get points on the curves instead of the control-points of the Bezier curve? Right now I have a function, that gives a GraphicsPath for two points with the index of the edge and the total number of the edges in between those two points.
Ps.: Sorry if this was asked before.