I am trying to create an image that contains nodes (represented as rectangles) and a path. Two consecutive nodes in the path should be connected with a directed edge (line and an arrowhead at the end). Each line should start at the center of a rectangle and point towards the center of the next rectangle in the path.
The question is whether there is any easy way to calculate the point where each arrow hits the rectangle. Rectangles are not necessarily aligned horizontally and/or vertically, so this is not trivial.
I have managed to come up with a solution that works quite well, but I had to remember all the geometry I was taught at school. Maybe there is an easier way to do it with rotations, instead of calculating directly the end point?