From 0786400a6768c050f2944112f74d8f07218f62f6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 11 Apr 2012 16:45:11 -0400 Subject: [PATCH] Adjust hatVect to place vector label at vector tip in Mechanics.asy. --- asymptote/Mechanics-test.asy | 3 +-- asymptote/Mechanics.asy | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.26.2