diff options
Diffstat (limited to 'graphics/circuit_macros/examples/Geometry.m4')
-rw-r--r-- | graphics/circuit_macros/examples/Geometry.m4 | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/graphics/circuit_macros/examples/Geometry.m4 b/graphics/circuit_macros/examples/Geometry.m4 index 771f4a6b7c..b5a59a0f10 100644 --- a/graphics/circuit_macros/examples/Geometry.m4 +++ b/graphics/circuit_macros/examples/Geometry.m4 @@ -1,5 +1,6 @@ .PS # Geometry.m4 +# Some constructions from https://tex.stackexchange.com/ gen_init Fig1: [ ls = 2/3 # local scale @@ -91,4 +92,63 @@ define(`textsize',`\Large') ] with .nw at Fig1.sw+(0.2,-0.3) +Fig4: [ + +# FourbarSVG.m4 +# https://tex.stackexchange.com/questions/563831/how-to-draw-four-bar-linkage-with-center-of-mass +ls = 1/25.4 # local scale + + a = 18*ls + b = 73*ls + c = 47*ls + d = 72*ls + A0: Here + B0: A0+(d,0) + circlerad = 1*ls + +define(`pivot',`[ + C: circle + line down_ 4*ls from C+(2*ls,0) + arc from last line.start to C+(-2*ls,0) with .c at C + line down_ 4*ls + B: line thick 1.6 right 7*ls with .c at (C,Here) + thinlines_ + sep = 0.9*ls + nhash = B.len/sep + for i=0 to nhash do { line down sep left sep from B.end-(i/nhash*B.len,0) } + thicklines_ + ]') + + pivot with .C at A0; "$A_0$" at A0-(5,0)*ls + circle dashed rad a at A0 + pivot with .C at B0; "$B_0$" at B0-(5,0)*ls + "$d = A_0B_0$" at 0.5<A0,B0> + + B1: Cintersect(A0,a+b,B0,c) + B2: Cintersect(A0,b-a,B0,c) + arc dashed from B1 to B2 with .c at B0 + + A0B1: line thick 1.6 from A0 to B1 chop 2*ls chop 0 + line thick 1.6 from B0 to B1 chop 2*ls chop 0 "$c$" ljust + circle fill_(1) at B1; "$B_1$" wid 3*ls at B1+(5,0)*ls + A1: circle fill_(1) at LCintersect(A0B1,A0,a,R) + "$A_1$" at A1+(5,0)*ls + + A2: b/(b-a) between B2 and A0; "$a$" at 0.4<A2,A0> above rjust + "$b$" at 0.4<A1,B1> above rjust + A2B2: line thick 1.6 from A2 to B2 + line thick 1.6 from B0 to B2 chop 2*ls chop 0 + circle fill_(1) at B2; "$B_2$" at B2+(5,0)*ls + circle fill_(1) at A2; "$A_2$" at A2+(5,0)*ls + + thinlines_ + line from B0+(3*ls,0) right 4*ls + ArcAngle(Here,B0,B1,5*ls) ->; "$\psi_0$" at last arc.ne above ljust + ArcAngle(B1,B0,B2,8*ls) ->; "$\psi$" at last arc.n+(-3*ls,0) above + ArcAngle(A1,A0,B2,b*0.45) ->; "$\theta$" at last arc.start+(0,4*ls) + line from A0+(3*ls,0) right 8*ls + ArcAngle(Here,A0,B1,9*ls) ->; "$\theta_0$" at last arc.start+(2,2)*ls + + ] with .nw at Fig3.ne+(0.2,0.2) + .PE |