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


Groups > comp.soft-sys.math.mathematica > #8291

Re: Plotter for complex polynomials (complex coefficients)

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Plotter for complex polynomials (complex coefficients)
Date 2012-02-02 10:01 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jgdmtm$qo5$1@smc.vnet.net> (permalink)
References <201202010851.DAA15238@smc.vnet.net>

Show all headers | View raw


This seems a little faster:

Manipulate[
  Module[{f, z},(*Convert 2D point to complex point*)
   f[z_] = a.{1, I} z^3 + b.{1, I} z^2 + c.{1, I} z + d.{1, I};
   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}]

Bobby

On Wed, 01 Feb 2012 02:51:32 -0600, Chris Young <cy56@comcast.net> wrote:

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


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Plotter for complex polynomials (complex coefficients) DrMajorBob <btreat1@austin.rr.com> - 2012-02-02 10:01 +0000
  Re: Plotter for complex polynomials (complex coefficients) Chris Young <cy56@comcast.net> - 2012-02-11 20:47 +0000

csiph-web