3
$\begingroup$

quadrellipse

The central red curve defined by 4 points in the diagram above is called a "quadriellipse" (not sure). How do I plot it in Mathematica?

$\endgroup$
5
  • $\begingroup$ what have you tried? Do you know anything about the mathematics of the figure you've shown? $\endgroup$
    – george2079
    Mar 6, 2018 at 2:45
  • $\begingroup$ I tried to find there are blue,pink,green, yellow 4 Cardioid. $\endgroup$
    – kittygirl
    Mar 6, 2018 at 2:55
  • $\begingroup$ Where did you get this picture from? $\endgroup$ Mar 6, 2018 at 3:23
  • $\begingroup$ @J.M.from this link $\endgroup$
    – kittygirl
    Mar 6, 2018 at 3:45
  • 1
    $\begingroup$ Next time, please include the sources of any image you are using that you did not generate yourself. $\endgroup$ Mar 6, 2018 at 4:34

1 Answer 1

8
$\begingroup$

Converting the multipolar equation in the link into Cartesian form, here is a $4$-ellipse where the four foci are arranged in a square:

With[{pts = CirclePoints[{1, 0}, 4], d = 24/5 (* sum of distances *)}, 
     ContourPlot[Sum[EuclideanDistance[{x, y}, pt], {pt, pts}] == d,
                 {x, -3/2, 3/2}, {y, -3/2, 3/2}, 
                 Epilog -> {Directive[Red, AbsolutePointSize[4]], Point[pts]}]]

4-ellipse

This is only a portion of the full Cartesian curve; to see the full curve, we can use GroebnerBasis[] to obtain the rationalized Cartesian equation:

With[{d = 24/5}, 
     ContourPlot[First[GroebnerBasis[Sum[Sqrt[#.#] &[{x, y} - pt],
                                         {pt, CirclePoints[{1, 0}, 4]}] - d,
                                     {x, y}]] == 0 // Evaluate,
                 {x, -3, 3}, {y, -3, 3}, PlotPoints -> 105]]

the full curve


It was simple enough to make a Manipulate[] for playing with general $n$-ellipses, so I made one:

Manipulate[ContourPlot[Sum[EuclideanDistance[{x, y}, pt], {pt, pts}] == d,
                       {x, -5, 5}, {y, -5, 5}],
           {{d, 5}, 0, 20}, {{pts, N[CirclePoints[4]]}, Locator, LocatorAutoCreate -> All}]

n-ellipse generator

$\endgroup$

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.