Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6672 > unrolled thread

Contour lines in middle of contour sectors

Started byChris Young <cy56@comcast.net>
First post2011-11-24 11:55 +0000
Last post2011-11-24 11:55 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Contour lines in middle of contour sectors Chris Young <cy56@comcast.net> - 2011-11-24 11:55 +0000

#6672 — Contour lines in middle of contour sectors

FromChris Young <cy56@comcast.net>
Date2011-11-24 11:55 +0000
SubjectContour lines in middle of contour sectors
Message-ID<jalbbe$s8k$1@smc.vnet.net>
I want to have contour colors which are the same for negative and 
positive values of the argument of a complex function. I plan to 
distinguish the different signs of the argument by using different 
styles of contour lines, which will run in the middle of the 
corresponding sectors.

Unfortunately, everything is pretty slow with this level of 
complication. Any tips on speeding it up while still doing what I want?

A picture is at:

http://home.comcast.net/~cy56/Complex2Roots.png

 and a notebook at:

http://home.comcast.net/~cy56/Complex2Roots.nb



hues = {0, 0.05, 0.075, 0.15, 0.23, 0.28, 0.35, 0.28, 0.23, 0.15, 0.075, 0.05};
hueSpecs = Hue /@ hues;
hsbSpec[j_, s_, b_] := Hue[hues[[j]], s, b];
hsbList[hues_, s_, b_] = Table[hsbSpec[j, s, b], {j, 1, Length[hues]}];


opts = {
   PlotPoints -> 50,
   ColorFunctionScaling -> False,
   ExclusionsStyle -> Directive[Red, AbsoluteThickness[Tiny]]
   (*PerformanceGoal -> "Quality"*)
   };


shadingPlot[f_, x0_, x1_, y0_, y1_, sat_, bri_] :=
 ContourPlot[
  f,
  {x, x0, x1}, {y, y0, y1},
  
  ContourStyle -> None,
  Contours -> Range[-165 °, 165 °, 30 °],
  ContourShading -> hsbList[hues, sat, bri],
  
  opts // Evaluate
  ]




contourLinePlot[f_, x0_, x1_, y0_, y1_, sat_, bri_] := 
 ContourPlot[
  f,
  {x, x0, x1}, {y, y0, y1},
  
  ContourShading -> None,
  Contours -> Range[-180 °, 180 °, 30 °],
  ContourStyle -> hsbList[hues, sat, bri],
  
  opts // Evaluate
  ]




Manipulate[
 DynamicModule[
  {arg, A, B},
  
  arg = Arg[(z - A) (z - B)] /.
    {
     A -> a[[1]] + a[[2]] I,
     B -> b[[1]] + b[[2]] I,
     z -> (x + I y)
     };
  
  Show[
   shadingPlot[arg, x0, x1, y0, y1, sat, bri],
   contourLinePlot[arg, x0, x1, y0, y1, 1, 1]
   ]
  ],
 
 "Complex function of two roots, a and b",
 {{a, {-1, 0}}, Locator},
 {{b, {1, 0}}, Locator},
 {{x0, -4}, -4, 4},
 {{x1, 4}, -4, 4},
 {{y0, -4}, -4, 4},
 {{y1, 4}, -4, 4},
 {{sat, 0.5}, 0, 1},
 {{bri, 1}, 0, 1}
 ]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web