Skip to main content
added 738 characters in body
Source Link
Simon Woods
  • 85.4k
  • 8
  • 180
  • 326

You can use ContourPlot to draw the function and Show to combine it with the other graphics:

With[{p = 
   ContourPlot[((x + 1)^2 + y^2)*((x - 1)^2 + y^2) == (1.2)^2, 
     {x, -3, 3}, {y, -3, 3}, Frame -> False]}, 
 Manipulate[
  Show[p, Graphics[{Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H]}, 
    Axes -> True]], {H, Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]]

enter image description here

To show the Cassini Oval being drawn as you move the slider, I would suggest using a ParametricPlot. First use Solve to obtain a parametric description of the curve:

sol = {x, y} /. Solve[{
     ((x + 1)^2 + y^2) == h^2,
     ((x - 1)^2 + y^2) == (1.2/h)^2},
    {x, y}];

Then put a parametric plot of sol into the Manipulate.

Manipulate[
 ParametricPlot[sol, {h, Sqrt[1.2 + 1] - 1, H},
  Epilog -> {Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H],
    PointSize[Large], Point[sol /. h -> H]},
  PlotRange -> 4, PlotStyle -> Thick],
 {H, $MachineEpsilon + Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]

enter image description here

You can use ContourPlot to draw the function and Show to combine it with the other graphics:

With[{p = 
   ContourPlot[((x + 1)^2 + y^2)*((x - 1)^2 + y^2) == (1.2)^2, 
     {x, -3, 3}, {y, -3, 3}, Frame -> False]}, 
 Manipulate[
  Show[p, Graphics[{Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H]}, 
    Axes -> True]], {H, Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]]

enter image description here

You can use ContourPlot to draw the function and Show to combine it with the other graphics:

With[{p = 
   ContourPlot[((x + 1)^2 + y^2)*((x - 1)^2 + y^2) == (1.2)^2, 
     {x, -3, 3}, {y, -3, 3}, Frame -> False]}, 
 Manipulate[
  Show[p, Graphics[{Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H]}, 
    Axes -> True]], {H, Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]]

enter image description here

To show the Cassini Oval being drawn as you move the slider, I would suggest using a ParametricPlot. First use Solve to obtain a parametric description of the curve:

sol = {x, y} /. Solve[{
     ((x + 1)^2 + y^2) == h^2,
     ((x - 1)^2 + y^2) == (1.2/h)^2},
    {x, y}];

Then put a parametric plot of sol into the Manipulate.

Manipulate[
 ParametricPlot[sol, {h, Sqrt[1.2 + 1] - 1, H},
  Epilog -> {Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H],
    PointSize[Large], Point[sol /. h -> H]},
  PlotRange -> 4, PlotStyle -> Thick],
 {H, $MachineEpsilon + Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]

enter image description here

Source Link
Simon Woods
  • 85.4k
  • 8
  • 180
  • 326

You can use ContourPlot to draw the function and Show to combine it with the other graphics:

With[{p = 
   ContourPlot[((x + 1)^2 + y^2)*((x - 1)^2 + y^2) == (1.2)^2, 
     {x, -3, 3}, {y, -3, 3}, Frame -> False]}, 
 Manipulate[
  Show[p, Graphics[{Circle[{-1, 0}, H], Circle[{1, 0}, 1.2/H]}, 
    Axes -> True]], {H, Sqrt[1.2 + 1] - 1, Sqrt[1.2 + 1] + 1}]]

enter image description here