4
$\begingroup$

It is well-known that a "heart" is topologically equivalent to a "zero".

heart and zero

where $$(x^2+y^2-1)^3=x^2y^3$$ is the heart equation; and $$\frac{x^2}{2}+\frac{y^2}{3}=1$$ is the equation of the zero shape (an ellipse).

How do I animate a homotopy from the heart to zero?

$\endgroup$
12
$\begingroup$

Here is a simple-minded smooth homotopy between the two curves in the OP, using a Hermite interpolant for keyframing:

hcubic[t_] = InterpolatingPolynomial[{{{0}, 0, 0}, {{1}, 1, 0}}, t];

Animate[ContourPlot[(1 - hcubic[t]) ((x^2 + y^2 - 1)^3 - x^2 y^3) +
                    hcubic[t] (x^2/2 + y^2/3 - 1) == 0,
                    {x, -3/2, 3/2}, {y, -7/4, 7/4},
                    ContourStyle -> Directive[AbsoluteThickness[4],
                    Blend[{ColorData[61, 8], ColorData[61, 7]}, t]]],
        {t, 0, 1, 1/30}]

heart to ellipse

$\endgroup$
9
$\begingroup$

Code from years ago, adapted for Manipulate, for a pre-calculus course: Move m to see the homotopy. (I used it at the end of the function-graph transformations to show "translating by a function" instead of by a constant.) The other parameters were for finding a good-looking shape for class. You can adapt or add coefficients for the desired "zero."

Manipulate[
 ContourPlot[-((y - m (x^2)^(1/3))^2 + x^2 - a^2) == l,
  {x, -a, a}, {y, -a, a + 1}, PlotPoints -> 101, 
  ColorFunction -> (RGBColor[#/2 + 0.5, #^4, #^4] &), Axes -> False, 
  Frame -> False],
 {m, 0, 1},
 {{a, 2}, 0, 4},
 {{l, 0}, -5, 5}
 ]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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