Alan Bromborsky - 2023-03-03

Here is a simple code example -

import graph;
size(20cm,10cm,IgnoreAspect);

xaxis("$X$",xmin=10,xmax=20,Ticks);
yaxis("$Y$",ymin=0,ymax=100,Left,Ticks);

pair p1 = (12.5,20);
pair p2 = (17.5,75);

draw(p1--p2);

real len = 1cm;
real ext = 1cm;

arrow(Label("dim"),p1,W,len,E,margin=NoMargin);
arrow((p2.x,p1.y),E,len,W,margin=NoMargin);

arrow(p1,S,len,N,margin=NoMargin);
arrow(Label("dim"),(p1.x,p2.y),N,len,S,margin=NoMargin);

with attached output.

All I want to do is shift the two horizontal arrows a given number of centimeters north and draw extension lines from the original arrow positions to the new arrow positions and have the label for the left arrow right justified with respect to the start of the shifted arrow. Also do likewise for the vertical distance between p1 p2. How do I specify the arrow lengths and extension lines in cm and not in plot units defined by xmin, xmax, ymin, and ymax and how do I justify the label positions so the labels do not overwrite the arrows?