Can anyone help me create a line with a label like thisshown in the picture below? The line is cut indiscontinuous near the middle to accomodate the label. The label is placed on top to avoid the probelemproblem when toothe two points are too close.
This is what I have so far.:
lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
{Thickness[0.01], color, Line[{a1, a2}]}]
Graphics@lines[{{1, 2}, {3, 5}}, Red]
My plan is to make the line segments about 4/10 of the distance between two points but I'm having problem making that thefrom each end points is on the line through two points instead ofas shown in the outsidefollowing image.