I want to create a graph using Asymptote and this graph consists of quite some circles with lines between them. Let me give a small example using two circles.
pair a1=(4.5,2);
pair a2=(0,0);
real r=0.25;
path c1=circle(a1,r);
path c2=circle(a2,r);
draw(c1);
draw(c2);
Now, I have tried several ways to draw a simple, though nice line:
draw(a1--a2, arrow=MidArrow(size=8));
draw(c1--c2, arrow=MidArrow(size=8));
draw(a1+(0,-r)--a2+(0,r), arrow=MidArrow(size=8));
None one of them gives the result I want. The first has line segments inside the circles, the second does not start the line at logical places and the third solution does not look natural. I would want the line a1--a2
, so the shortest line between the two circles, but without the line segments inside the circles.
Is there a way to shorten this line by r
at both sides? This way I do not have to calculate the exact coordinates of where the a1--a2
line crosses the circle, since I want to be able to move the circles around.