In the README of the repository, I have mentioned a link to a five year old Reddit thread where I have discussed this in detail. Here's the reddit thread: https://www.reddit.com/r/math/comments/1xwuv3/a_mathematical...

Some of the "plot" links to WolframAlpha in that thread do not show the example graphs anymore, so let me rewrite that comment here with updated links. Rewritten comment with updated link now follows.

---

I wanted something that resembles the hearts in playing cards more than it resembles a cardoid, so I made a simpler heart for my girlfriend (now my wife) composed of two simple curves. The heart is plotted with two semicircles and segments of two quartic curves. Here is an explanation of how I arrived at these equations.

PART 1 - Plotting the Two Semicircles

First, we want to draw a circle of radius 1/2 centered at (1/2, 0). We start with an equation of a circle: (x - 1/2)^2 + y^2 = (1/2)^2 ⇔ x^2 - x + y^2 = 0 ⇔ y^2 = x(1 - x). Plot: https://www.wolframalpha.com/input/?i=y%5E2%20%3D%20x%281%20...

With the previous equation, we got both negative and positive values of y, hence a full circle. We want to eliminate the negative values of y, thereby resulting in a semicircle lying above the x-axis. We take square root of both sides: y = sqrt(x(1 - x)). Plot: https://www.wolframalpha.com/input/?i=sqrt%28x%281%20-%20x%2...

Now, we want a mirror image of this curve on the left side of the y-axis, i.e., for negative values of x, we want the same values of y that we see in the above plot. We do this by substituting x with |x| in the above equation: y = sqrt(|x|(1 - |x|)). Plot: https://www.wolframalpha.com/input/?i=Re%28sqrt%28abs%28x%29...

This completes the top portion of the heart with two semicircles.

PART 2 - Plotting the Segments of Two Quartic Curves

Now we try to complete the bottom portion of the heart. I didn't start with quartic curves. Instead, I began with parabolas and arrived at quartic curves. We begin with a single parabola: y^2 = 1 - x. Plot: https://www.wolframalpha.com/input/?i=y%5E2+%3D+1+-+x

We go through the same drill. We first eliminate negative values of y and then mirror the graph on the left side of the y axis: y = sqrt(1 - |x|). Plot: https://www.wolframalpha.com/input/?i=Re%28sqrt%281%20-%20ab...

Let us get a mirror of this plot below the x-axis by multiplying the right hand side by -1: y = -sqrt(1 - |x|). Plot: https://www.wolframalpha.com/input/?i=Re%28-sqrt%281%20-%20a...

But I wanted to get a little bit of concave curvature at the bottom of the curves to resemble the hearts in playing cards. I could get this by a little trick I learnt somewhere online: We can vary the power of |x| between 0.5 and 1.0 to get different curvatures, i.e., we can vary r in y = -sqrt(1 - |x|^r) where 0.5 <= r <= 1.0 to get different curvatures. I liked the concave curvature with r = 0.5, so I chose y = -sqrt(1 - sqrt(|x|)). This turns the segments of parabolas into segments of quartic curves. Plot: https://www.wolframalpha.com/input/?i=Re%28-sqrt%281%20-%20s...

PART 3 - Plotting the Two Curves Together

Let us combine the two equations together. The equations for both curves are: y = sqrt(|x|(1 - |x|)), y = -sqrt(1 - sqrt(|x|)). Plot: https://www.wolframalpha.com/input/?i=%7By%20%3D%20Re%28sqrt...

PART 4 - Scaling the Second Curve

Finally, in the actual plot I printed, laminated, and presented to my girlfriend, I have multiplied the second equation by 1.5 to stretch the bottommost point of the heart from y = -1 to y = -1.5. Since I used equal scaling (aspect ratio = 1) for both axes and printed it without any scaling to get a high quality print, stretching the bottom of the heart was necessary to make the heart look beautiful and wholesome. Plot: https://github.com/susam/heart/blob/master/heart-2014-02-14....