The actual function being plotted is the two ellipsoids
1 = x^2 + (x - y)^2 + z^2 for x >= 0
1 = x^2 + (x + y)^2 + z^2 for x <= 0
Each of which which is just an ordinary ellipse but rotated a little along the z-axis. If you expand the square and by standard linear algebra techniques (see: diagonalising a quadratic form), you can put both of these in standard form:
1 = x^2/a^2 + y^2/b^2 + z^2
which confirms it's an ellipsoid.
Whoever made the original heart just took these two ellipses and then multiplied by the cosine of the height in order to give it some oscillations and make it look more showy, but the basic idea is just that: two ellipsoids, at opposite slant angles, joined along the middle.
The actual function being plotted is the two ellipsoids
1 = x^2 + (x - y)^2 + z^2 for x >= 0
1 = x^2 + (x + y)^2 + z^2 for x <= 0
Each of which which is just an ordinary ellipse but rotated a little along the z-axis. If you expand the square and by standard linear algebra techniques (see: diagonalising a quadratic form), you can put both of these in standard form:
1 = x^2/a^2 + y^2/b^2 + z^2
which confirms it's an ellipsoid.
Whoever made the original heart just took these two ellipses and then multiplied by the cosine of the height in order to give it some oscillations and make it look more showy, but the basic idea is just that: two ellipsoids, at opposite slant angles, joined along the middle.