3
$\begingroup$

I have the following Manipulate to graphically show the n-th roots of unity:

Manipulate[ListPlot[Map[ReIm[#[[1, 2]]] &, Solve[z^n == 1, z]], AspectRatio -> 1, PlotRange -> {{-1, 1}, {-1, 1}}], {n, 2, 128, 1}]

Now, I want to change the z^n == 1 to z^n == p[[1]] + I * p[[2]] where p comes from a Locator.

How do I have to change the above Manipulate so that I can add a Locator?

$\endgroup$
5
$\begingroup$
Manipulate[ListPlot[Map[ReIm[#[[1, 2]]] &, Solve[z^n == pt.{1, I}, z]], 
   AspectRatio -> 1, PlotRange -> {{-1, 1}, {-1, 1}}],
 {n, 2, 128, 1}, {{pt, {1, 1}}, Locator}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you. ( I thought that I had tried that but got an error message..., anyway it does work now. ) $\endgroup$ – nilo de roock Jul 15 at 20:27
  • $\begingroup$ @nilo, my pleasure. $\endgroup$ – kglr Jul 15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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