From: W. Trevor King Date: Wed, 11 Apr 2012 20:45:11 +0000 (-0400) Subject: Adjust hatVect to place vector label at vector tip in Mechanics.asy. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0786400a6768c050f2944112f74d8f07218f62f6;p=course.git Adjust hatVect to place vector label at vector tip in Mechanics.asy. --- diff --git a/asymptote/Mechanics-test.asy b/asymptote/Mechanics-test.asy index 42897d7..e282df2 100644 --- a/asymptote/Mechanics-test.asy +++ b/asymptote/Mechanics-test.asy @@ -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")); diff --git a/asymptote/Mechanics.asy b/asymptote/Mechanics.asy index 96e1a9b..a324654 100644 --- a/asymptote/Mechanics.asy +++ b/asymptote/Mechanics.asy @@ -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; }