Simplify Spring labeling to respect Label attributes in Mechanics.asy.
[course.git] / asymptote / Mechanics-test.asy
index 69ec1b037521cdb25f026fac38012e2e3226dd30..e0017bdf6686aae852a1155403b472b27813cbbe 100644 (file)
@@ -82,9 +82,12 @@ Pendulum p = makePendulum(
     angleL="$\rho$", stringL=Label("r", embed=Shift));
 
 real len = abs(p.pivot.x-b.center().x);
-Spring s = Spring(pFrom=b.center()-(2u,0), pTo=b.center(), L="$k_1$");
+Spring s = Spring(
+    pFrom=b.center(), pTo=b.center()-(2u,0), L=Label("$k_1$", align=N));
 s.draw();
-s = Spring(pFrom=b.center(), pTo=(p.pivot.x, b.center().y), L="$k_2$");
+s = Spring(
+    pFrom=b.center(), pTo=(p.pivot.x, b.center().y+0.5u),
+    L=Label("$k_2$", align=LeftSide, position=Relative(0.7)));
 s.draw();
 
 p.draw(drawVertical=true);