0

An ellipse degenerates into a line segment when the defining constant distance from the two foci is the actual distance between the two foci. The ellipse closes into a line segment.

The following code shows a family of concentric ellipses that should converge to a line segment when the constant is set to 5. However it doesn't plot the line segment even if I increase the MaxRecursion very high.

ContourPlot[Evaluate[Table[Sqrt[(x + 3)^2 + y^2] + Sqrt[x^2 + (y - 4)^2] == n, {n, 5, 
6, .01}]], {x, -4, 1}, {y, -1, 5}]

Is there someway to get Mathematica to actually plot the line segment of the degenerate case of an ellipse?

David Caliri
  • 287
  • 1
  • 6

1 Answers1

1

You can get an ellipse almost at the center, but you will need to increase the number of points in the plot:

ContourPlot[Evaluate[Table[
   Sqrt[(x + 3)^2 + y^2] + Sqrt[x^2 + (y - 4)^2] == n, 
   {n, 5.0001, 6, .1}]], {x, -4, 1}, {y, -1, 5}, PlotPoints -> 200]

enter image description here

It looks even more line-like if you decrease n to 5.00002 and increase PlotPoints to 600, though this dramatically increases the time required to draw the plot.

bill s
  • 68,936
  • 4
  • 101
  • 191