2

1

I'm new to *Mathematica* and I need some help with the following problem. I would like given some positive integer n, to have mathematica plot the level sets of a (say monic) polynomial of degree n, p(z), with roots z_j in the unit disk. The trick is that I want to be able to change the position of z_j in an interactive way (e.g dragging them around inside the unit disk or choose the roots in advance by clicking at some points in the plane and then have *Mathematica* read that input and draw the level set of the corresponding polynomial). For example, I've tried something like the following piece of code (for n=2) but it's not exactly what I need. Any help is appreciated. Thank you!

```
Manipulate[
Show[ContourPlot[
Abs[(x + I*y - x1 - I*y1) (x + I*y - x2 - I*y2)] ==
Abs[(x1 + I*y1) (x2 + I*y2)], {x, -15, 15}, {y, -15, 15}]],
{{x1, {-5, 5}}, Locator}, {{y1, {-5, 5}}, Locator},
{{x2, {-5, 5}}, Locator}, {{y2, {-5, 5}}, Locator}]
```

Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise.

– bbgodfrey – 2015-05-04T04:22:15.063What exactly do you need? It seems to work in the way you describe. Is the problem with the equation

`Abs[(x + I*y - x1 - I*y1) (x + I*y - x2 - I*y2)] == Abs[(x1 + I*y1) (x2 + I*y2)]`

? You could plot the real and imaginary parts, but I don't know if that would be what you want. – Michael E2 – 2015-05-04T10:30:53.637For a start I can suggest this:

`Manipulate[Show[ContourPlot[Abs[(x + I*y - Complex @@ x1) (x + I*y - Complex @@ x2)] == Abs[(Complex @@ x1) (Complex @@ x2)], {x, -15, 15}, {y, -15, 15}]], {{x1, {-5, 5}}, Locator}, {{x2, {-5, 5}}, Locator}]`

– LLlAMnYP – 2015-05-04T11:40:14.457@MichaelE2 My problem with my code was that I did not want to have to move the points by real and imaginary part separately but rather than complex numbers on the plane. – Trav – 2015-05-04T19:02:16.363