Adjust hatVect to place vector label at vector tip in Mechanics.asy.
authorW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 20:45:11 +0000 (16:45 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 20:45:11 +0000 (16:45 -0400)
asymptote/Mechanics-test.asy
asymptote/Mechanics.asy

index 42897d7f8b8a7c19f794fe0e1aa86a987b5d74fb..e282df290e81a1fa56f116b7c4cb375650b270ab 100644 (file)
@@ -61,8 +61,7 @@ Angle as[] = {bac1, bac2, bac3};
 
 Vector vs[];
 
-vs.push(ihat(center=(0,u)));
-vs.push(jhat(center=(0,u)));
+draw_ijhat((-u, u));
 
 vs.push(Vector(center=(-1u,-4u), phi=90, "Out"));
 vs.push(Vector(center=(-1u,-5.5u), phi=-90, "In"));
index 96e1a9bf72588f8dd2b95d8946f6ad20fe032dd9..a3246547593cb654cdf1258a48ed82d603182c43 100644 (file)
@@ -390,8 +390,10 @@ struct Angle {
 }
 
 Vector hatVect (string name,  pair center=(0,0), real dir=0, real phi=0) {
-  string L = replace("$\mathbf{\hat{X}}$", "X", name);
-  Vector v = Vector(center=center, mag=5mm, dir=dir, phi=phi, L=L, outline=rgb(0,0,0));
+  string s = replace("$\mathbf{\hat{X}}$", "X", name);
+  Label L = Label(s, position=EndPoint, align=RightSide);
+  Vector v = Vector(
+      center=center, mag=5mm, dir=dir, phi=phi, L=L, outline=rgb(0,0,0));
   return v;
 }