MathGroup Archive 2012

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

Search the Archive

Plotter for complex polynomials (complex coefficients)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124706] Plotter for complex polynomials (complex coefficients)
  • From: Chris Young <cy56 at comcast.net>
  • Date: Wed, 1 Feb 2012 03:51:32 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

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




  • Prev by Date: Re: select 1st column element based on criteria in 2nd AND 3rd column
  • Next by Date: Re: Trying to close some loose plotting
  • Previous by thread: Re: Derivative of experimental data
  • Next by thread: Re: Plotter for complex polynomials (complex coefficients)