# Visualization of Homotopy equivalence between “heart curve” and zero

It is well-known that a "heart" is topologically equivalent to a "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?

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,
Blend[{ColorData[61, 8], ColorData[61, 7]}, t]]],
{t, 0, 1, 1/30}] 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}
] 