2
$\begingroup$

How can I plot the hyperbola represented by the following complex equation:

$$\left|z-a\right|-\left|z-b\right|=2t\tag{1}$$

Should I convert (1) into the following form?

ContourPlot[x^2 - y^2 == 1, {x, -2, 2}, {y, -2, 2}]

contour plot of hyperbola

$\endgroup$
3
  • $\begingroup$ You can start from ComplexExpand[Abs[x + I y - a] - Abs[x + I y - b], TargetFunctions -> {Re, Im}], which doe not give an hyperbola though. $\endgroup$ Jul 21, 2013 at 8:59
  • $\begingroup$ Are you sure the complex expression above is a hyperbola? What do the $a, b, t$ stand for? Assuming that the $a$ and $b$ are the same as in $\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1$, then that is not a hyperbola. For instance, what happens when $a=b$? $\endgroup$
    – rm -rf
    Jul 21, 2013 at 16:36
  • $\begingroup$ You can the function defined here: Coloring a shape according to a function, e.g. ParametricPlot[cc[u, 3/2], {u, 0, 2 Pi}, Axes -> False, PlotStyle -> Thick, ColorFunction -> Function[{x, y, u}, Hue[u/(2 Pi)]], ColorFunctionScaling -> False, Exclusions -> {Cos[u] == 2/3, Cos[u] == -2/3}] $\endgroup$
    – Artes
    Jul 21, 2013 at 18:21

1 Answer 1

7
$\begingroup$

Since you're trying to plot an implicit equation, you would normally use ContourPlot. For example, to get two branches satisfying the equation for $t = 1$, just do this:

With[{a = 2, b = 1},
 ContourPlot[
  Abs[x + I y - a] - Abs[x + I y - b], {x, -1, 3}, {y, -2, 2}, 
  Contours -> {1/2, -1/2}, ContourShading -> False, 
  ContourStyle -> ColorData[1][1]
  ]
 ]

contours

$\endgroup$

Your Answer

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

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