MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Contour lines in middle of contour sectors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123118] Contour lines in middle of contour sectors
  • From: Chris Young <cy56 at comcast.net>
  • Date: Thu, 24 Nov 2011 06:54:00 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

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}
 ]




  • Prev by Date: Re: Texture on Disk in Mathematica 8?
  • Next by Date: Root finding needs higher accuracy
  • Previous by thread: Re: Forcing Certain Algebraic Forms With FullSimplify
  • Next by thread: Root finding needs higher accuracy