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$
0

1 Answer 1

8
$\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$
1
  • 1
    $\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$ Commented Dec 31, 2018 at 13:58

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.