--- /dev/null
+// Upper half plane contour integral
+
+import graph;
+size(5cm, 5cm);
+
+real r=2cm;
+
+pen p_axes = linewidth(0.5*linewidth())+grey;
+draw((-1.2r,0)--(1.2r,0), p_axes, Arrow);
+label("Re", (1.2r, 0), S);
+draw((0,0)--(0,1.2r), p_axes, Arrow);
+label("Im", (0, 1.2r), W);
+
+pen p_contour = linewidth()+blue;
+draw((-r,0)--(r,0), p_contour);
+draw((0,0)--(r/2,0), p_contour, Arrow);
+draw(arc((0,0), r, 0, 180, CCW), p_contour);
+++ /dev/null
-MPS = contour
-
-
-TEMP_FILES = $(MPS:%=%.mp[a-z]) $(MPS:%=%.log) mp* texnum.mpx
-GENERATED_FILES = $(MPS:%=%.[0-9]*) sample.log sample.aux sample.pdf
-
-#PDFVIEWER = gv
-PDFVIEWER = xpdf
-#PDFVIEWER = evince
-
-images : $(MPS:%=%.1)
-
-all : view
-
-view : sample.pdf
- $(PDFVIEWER) sample.pdf &
-
-clean : semi-clean
- rm -f $(GENERATED_FILES)
-
-semi-clean :
- rm -f $(TEMP_FILES)
-
-# generate a pdf containing all mp images for previewing-troubleshooting
-# depend on the first image from each mp file
-sample.pdf : sample.tex images
- pdflatex sample.tex
-
-# if we call for the first image from an mp file, make them all
-%.1 : %.mp
- mpost $<
+++ /dev/null
-%% Sarcomere graphic
-
-boolean labels; labels := false;
-
-% coloring in rgb
-color axis_color, contour_color, text_color;
-%acolor = (0,.1736,.62); % drexel blue
-%mcolor = (1,0.85,0.24); % drexel yellow
-axis_color = (0,0,0); % black
-contour_color = (0,0,1); % blue
-text_color = (0,0,0); % black
-
-% sizing
-numeric radius;
-radius := 0.7;
-u := 2cm; % define units
-
-% Generate and draw axes with labels.
-% Origin at CENTER,
-% LL (lower left) and UR (upper right) define the length of the axis markings
-% XLABEL and YLABEL contain text to label the axes
-def draw_axis(expr center, ll, ur, xlabel, ylabel) =
- save start, stop;
- pair start, stop;
-
- % draw X
- start := (ll dotprod (1,0),0); % get the x portion
- stop := (ur dotprod (1,0),0);
- drawarrow start .. stop withcolor axis_color;
- label.bot(xlabel, stop) withcolor text_color;
-
- % draw Y
- start := (0, ll dotprod (0,1)); % get the y portion
- stop := (0, ur dotprod (0,1));
- drawarrow start .. stop withcolor axis_color;
- label.lft(ylabel, stop) withcolor text_color;
-enddef;
-
-% Generate and draw a semicircle in the upper half plane
-% Centered at CENTER with radius RAD.
-def draw_UHP_semicircle(expr center, rad) =
- % straight line
- draw (center-(rad,0)) .. (center+(rad,0)) withcolor contour_color;
- % semicircle
- draw (center-(rad,0)){up} .. tension(1) .. {down}(center+(rad,0))
- withcolor contour_color;
- drawarrow center .. (center+(rad/2,0)) withcolor contour_color;
-enddef;
-
-beginfig(1)
- draw_axis(origin, -(u,0.2u), (u,u), "Re", "Im");
- draw_UHP_semicircle(origin, radius * u);
-endfig;
-
-end