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


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

Plotter for complex polynomials (complex coefficients)

Started byChris Young <cy56@comcast.net>
First post2012-02-01 08:54 +0000
Last post2012-02-01 08:54 +0000
Articles 1 — 1 participant

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


Contents

  Plotter for complex polynomials (complex coefficients) Chris Young <cy56@comcast.net> - 2012-02-01 08:54 +0000

#8283 — Plotter for complex polynomials (complex coefficients)

FromChris Young <cy56@comcast.net>
Date2012-02-01 08:54 +0000
SubjectPlotter for complex polynomials (complex coefficients)
Message-ID<jgauk3$eu3$1@smc.vnet.net>
Not sure if this is done right. Could I speed it up by using Set 
instead of SetDelayed in the converter to complex point? If so, 
shouldn't I protect the "z" by wrapping the definition in a Module with 
"z" as a local variable?

I have the coloring going from green for 0 to red for π and then back 
again, so colors are the same for plus and minus arguments (i.e., 
angles) for the complex polynomial. Probably should have some 
indication which is which, or a way to toggle it.

http://home.comcast.net/~cy56/Mma/ComplexCoeffPlotter.nb
http://home.comcast.net/~cy56/Mma/ComplexCoeffPlotterPic2.png

Chris Young
cy56@comcast.net


Manipulate[
 Module[
  {f, \[ScriptCapitalC]},

  \[ScriptCapitalC][P_] := P[[1]] + P[[2]] I;   (*
  Convert 2D point to complex point *)

  f[z_] = \[ScriptCapitalC][a]  z^3 + \[ScriptCapitalC][
      b] z^2 + \[ScriptCapitalC][c] z + \[ScriptCapitalC][ d];

  Plot3D[
   Abs[f[x + y I]],   {x, -6, 6},  {y, -6, 6},

   PlotPoints -> 100,
   MaxRecursion -> 2,

   Mesh -> 11,
   MeshStyle -> Directive[Gray, AbsoluteThickness[0.01]],
   MeshFunctions -> ({x, y} \[Function] (\[Pi] -
       Abs[Arg[f[x + I y]]])/\[Pi]),

   ColorFunctionScaling -> False,
   ColorFunction -> ({x, y} \[Function]
      Hue[0.425 \[LeftFloor]12 (\[Pi] -
           Abs[Arg[f[x + I y]]])/\[Pi]\[RightFloor]/12, sat, bri]),
   PlotStyle -> Opacity[opac],
   AxesLabel -> {"x", "i y", "|f(x + iy)|"}]
  ],
 (*Item["The complex coefficients"],*)
 {a, {-2, -2}, {2, 2}},
 {b, {-2, -2}, {2, 2}},
 {c, {-2, -2}, {2, 2}},
 {d, {-2, -2}, {2, 2}},
 {{opac, 0.75, "Opacity"}, 0, 1},
 {{sat, 0.75, "Saturation"}, 0, 1},
 {{bri, 1, "Brightness"}, 0, 1},

 ControlPlacement -> {Left, Left, Left, Left, Bottom, Bottom, Bottom}
 ]

[toc] | [standalone]


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


csiph-web