6

I am $\TeX$ writing notes on complex analysis, I need to use figures of contour paths to integrate on them, how can I plot them on Mathematica, something like this

some contours

adding also the $\gamma_R$ legends in $\TeX$ if possible ?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Leo Sera
  • 165
  • 1
  • 6

2 Answers2

7

Preliminaries:

lin[x_] := {Arrowheads[{{0.05, 0.5}}], Arrow[Most@x]};
arc[x_] :=
  {Arrowheads[{{0.05, 0.5}}], 
   Arrow[Table[
     x[[1]] {Cos[j], x[[-2]] Sin[j]}, {j, x[[2]], x[[3]], 
      0.01 (x[[3]] - x[[2]])}]]};
cont[lst_] := If[#[[-1]] == "line", lin@#, arc@#] & /@ lst

Example of right most contour but you could adapt to others by specifying contour as list of elements (am time poor at present):

 im[d_, o_] := 
     Graphics[{Red, 
       cont[{{{o, d}, {1, d}, "line"}, {1, ArcTan[d], 2 Pi - ArcTan[d], 1,
           "arc"}, {{1, -d}, {o, -d}, "line"}, {Norm[{o, d}], ArcTan[d/o],
           2 Pi - ArcTan[d/o], -1, "arc"}}], Black, 
       Text["|z|=1/R", 2 Norm[{o, d}] {Cos[3 Pi/4], Sin[3 Pi/4]}]}, 
      Axes -> True, 
      Ticks -> {{{1.1, "R"}, {-1.1, "-R"}}, {{1.1, "i R"}, {-1.1, 
          "-i R"}}}, PlotRange -> {{-1.3, 1.3}, {-1.3, 1.3}}]

You can format text and contour as desired.

enter image description here

ubpdqn
  • 60,617
  • 3
  • 59
  • 148
  • Thanks a lot ! Loved the .gif !! – Leo Sera Jun 12 '15 at 00:47
  • What? No $\eta_R$? – David G. Stork Jun 12 '15 at 01:27
  • @DavidG.Stork yes I apologise for the omission for the labeling of the contour as well as the failure to suppress the tick mark (as you did with 0 option in tick specification). My principal aim was to start to generalize and illustrate with contour that was most "interesting"...done at midnight after 14 hour day...so not firing on all cylinders – ubpdqn Jun 12 '15 at 01:31
5
Graphics[
   {Text[Style["|z| = 1/R", 22, Italic, FontFamily -> "Times"], {-.4, .15}],
    Text[Style["\!\(\*SubscriptBox[\(\[Eta]\), \(R\)]\)", 22, Italic, 
    FontFamily -> "Times"], {.8, .8}],
  {Red, 
   {Arrowheads[.05], Arrow[{{.01, 1}, {-.01, 1}}]}, 
   {Arrowheads[.05], Arrow[{{-.01, -1}, {.01, -1}}]},
   {Arrowheads[.05], Arrow[{{.15, .05}, {.6, .05}}]},
   {Arrowheads[.05], Arrow[{{1, -.05}, {.4, -.05}}]},
   Line[{{.6, .05}, {1, .05}}],
   Line[{{.4, -.05}, {.15, -.05}}],
   Circle[{0, 0}, .15, {.3, 2 \[Pi] - .3}],
   Circle[{0, 0}, 1, {.05, 2 \[Pi] - .05}]}},
 Axes -> True, 
 Ticks -> {{{1.1, Text[Style["R", Italic, 24]], 0}, 
           {-1.1, Text[Style["-R", Italic, 24]], 0}}, 
          {{ 1.1, Text[Style["iR", Italic, 24]], 0}, 
           {-1.1, Text[Style["-iR", Italic, 24]], 0}}},
 PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}}]

enter image description here

David G. Stork
  • 41,180
  • 3
  • 34
  • 96