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.
2 Answers
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]]
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})]
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]
-
$\begingroup$ I think this solution expends way more effort than this problem warrants. $\endgroup$ Dec 10, 2015 at 14:30
ContourPlot[]
. $\endgroup$