0
$\begingroup$

This question already has an answer here:

I'm new to Mathematica, and I was wondering how to plot $x^n$ in the complex plane.

Is there a dedicated function for this purpose?

$\endgroup$

marked as duplicate by Artes, István Zachar, C. E., Simon Woods, Sjoerd C. de Vries Dec 15 '13 at 13:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

This is just for illustrative purpose. The links in the comments cover more in better detail. I post just to allow start:

Manipulate[
 GraphicsRow[{ParametricPlot[
    Through[{Re, Im}[ (x + I y)]], {x, -2, 2}, {y, -2, 2}, 
    ImageSize -> 200, MeshFunctions -> {#3^2 + #4^2 &, #3 - #4 &}, 
    MeshStyle -> {Directive[Red, Thick], Directive[Orange, Thick]}, 
    Mesh -> {{1, 0.5, 1.5}, {0, 1, -3}}],
   ParametricPlot[
    Through[{Re, Im}[ (x + I y)^n]], {x, -2, 2}, {y, -2, 2}, 
    MeshFunctions -> {#3^2 + #4^2 &, #3 - #4 &}, 
    Mesh -> {{1, 0.5, 1.5}, {0, 1, -3}}, 
    MeshStyle -> {Directive[Red, Thick], Directive[Orange, Thick]}, 
    ImageSize -> 200],
   Plot3D[Re[(x + I y)^n], {x, -2, 2}, {y, -2, 2}, Mesh -> False]}, 
  ImageSize -> {600, 400}], {n, {1, 2, 3, 4, 5}}]

This shows plots of $z^n$: the left plot is coplex plane, second plot is $z^n$ (colored mesh, could play with whatever you wanted) and the final plot the Re[z^n].

enter image description here

The following could be vastly improved but for illustration of transformation:

lin[x_, y_] := 
  Table[x + j Normalize@(y - x), {j, 0, Norm[y - x], Norm[y - x]/10}];
fc[x_] := Module[{p, tab},
   p = Partition[x, 2, 1, 1];
   tab = lin @@ # & /@ p];
cf[x_, n_] := {Re[#], Im[#]} & /@ (#^n & /@ Complex @@@ x)
DynamicModule[
 {pts = RandomReal[{-2, 2}, {6, 2}], n},
 Column[{
   SetterBar[Dynamic@n, {1, 2, 3, 4, 5}],
   LocatorPane[Dynamic@pts,
    Dynamic@Grid[
      {{
        Graphics[Polygon[pts], ImageSize -> {200, 200}],
        Graphics[Polygon[Join @@ (cf[#, n] & /@ fc[pts])], 
         ImageSize -> {200, 200}]
        }}, Frame -> All]]}]]

yields:

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.