Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6672
| From | Chris Young <cy56@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Contour lines in middle of contour sectors |
| Date | 2011-11-24 11:55 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jalbbe$s8k$1@smc.vnet.net> (permalink) |
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}
]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Contour lines in middle of contour sectors Chris Young <cy56@comcast.net> - 2011-11-24 11:55 +0000
csiph-web