2
$\begingroup$

Possible Duplicate:
Finding real roots of negative numbers (for example, $\sqrt\[3\]{-8}$)

I am trying to make Mathematica plot the cube roots of $27i$ and graph them, so that I can include them in my $\LaTeX$ed homework. How can I do this?

$\endgroup$

marked as duplicate by rm -rf, Verbeia, Oleksandr R., J. M. is away Sep 22 '12 at 2:43

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.

7
$\begingroup$

From @belisarius

pts = ({Re@#, Im@#} & /@ (x /. Solve[x^3 == 27 I]))

Styling:

Show[ContourPlot[Abs[(x + I y)^3 - 27 I], {x, -4, 4}, {y, -4, 4}, Contours -> 15],
 Graphics[{{Style[Text[#, #], 17] & /@ #}, {Opacity[.5], Orange, 
      Thickness[.01], Arrow[{{0, 0}, #}] & /@ #}, {Red, 
      PointSize[.02], Point@#}}, Axes -> True, Frame -> True, 
    PlotRangePadding -> 1, AspectRatio -> Automatic] &@pts]

enter image description here

Show[ContourPlot[Arg[(x + I y)^3 - 27 I], {x, -4, 4}, {y, -4, 4}, 
  Contours -> 15, ColorFunction -> "Rainbow"],
 Graphics[{{Style[Text[#, #], 17] & /@ #}, {Opacity[.5], Orange, 
      Thickness[.01], Arrow[{{0, 0}, #}] & /@ #}, {Red, 
      PointSize[.02], Point@#}}, Axes -> True, Frame -> True, 
    PlotRangePadding -> 1, AspectRatio -> Automatic] &@pts]

enter image description here

$\endgroup$
  • $\begingroup$ Since the question's title is "Plotting Complex Roots of Unity", here's a variation of your code that plots the roots of unity up to degree 32, with different point sizes: pts = Table[{Re@#, Im@#} & /@ (x /. Solve[x^n == 1]), {n, 1, 32}]; ListPlot[pts, { AspectRatio -> 1, PlotRangePadding -> 1/8, PlotStyle -> PointSize /@ (0.1/Length@# & /@ pts)}] !Roots of Unity $\endgroup$ – Mauro Lacy Dec 31 '18 at 13:58

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