0
$\begingroup$

How can I use Mathematica to draw locus of point in complex plane given by $||z-i|-|z+i||=1.$
I have tried few codes, but not succeed.

$\endgroup$
4
  • 4
    $\begingroup$ Replace $z$ with $x+iy$ and use ContourPlot[]. $\endgroup$ Dec 10, 2015 at 7:06
  • $\begingroup$ @J.M.: Aren't there any direct way to draw it? $\endgroup$
    – Bumblebee
    Dec 10, 2015 at 7:07
  • $\begingroup$ Nothing built-in. So, try my suggestion and report back. $\endgroup$ Dec 10, 2015 at 7:36
  • $\begingroup$ Thank you very much. Definitely I will report. $\endgroup$
    – Bumblebee
    Dec 10, 2015 at 9:47

2 Answers 2

1
$\begingroup$
f = Abs[z - I] - Abs[z + I] /. z :> x + I y;

Show[

 DensityPlot[f, {x, -10, 10}, {y, -2 Pi, 2 Pi},
  PlotPoints -> 60,
  ColorFunction -> "DarkRainbow",
  ImageSize -> 400],

 ContourPlot[{f == 1, -f == 1}, {x, -10, 10}, {y, -2 Pi, 2 Pi},
  ContourStyle -> Black,
  ImageSize -> 400]]

enter image description here

Or

DensityPlot[f, {x, -10, 10}, {y, -2 Pi, 2 Pi},
 PlotPoints -> 60,
 ColorFunction -> "DarkRainbow",
 ImageSize -> 400,
 Mesh -> {{1}},
 MeshFunctions -> (Function[{x, y}, #] & /@ {f, -f})]

enter image description here

$\endgroup$
2
$\begingroup$

This function finds the points that satisfy the complex equation and then plots it.

 complexPlot[complexEq_, range_, points_] := Module[{sol, data},

 sol = FindInstance[complexEq && -range < Re[z] < range, z, points];
 data = z /. sol;
 ListPlot[(Tooltip[{Re[#1], Im[#1]}] &) /@ data, AspectRatio -> 1, 
 PlotRange -> Full, Frame -> True, 
 FrameLabel -> {{"y", None}, {"x", None}}, 
 PlotLabel -> "Argand diagram"]
 ]

You can input your expression as it is in the complex form and specify the x range and number of data points.

f = Norm[Norm[z - I] - Norm[z + I]] == 1;
complexPlot[f, 10, 1000]

enter image description here

$\endgroup$
1
  • $\begingroup$ I think this solution expends way more effort than this problem warrants. $\endgroup$ Dec 10, 2015 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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