Let us learn how to make a heart in Desmos! We will do it step by step so you can follow why the shapes turn out the way they do.
Step 1: Draw a circle
First, let us draw a circle by giving the implicit form of the equation for a circle:
In the above equation, x^2+y^2=4 is the equation for a circle. The radius is 2 (ie the square root of 4) and the circle is centered at the origin.
Step 2: Move the circle around
To move the circle around, ie to have a different center, we need to update the equation as follows:
Here, note that the x^2 term has been updated to (x-2)^2. Similarly, the y^2 term has been updated to (y+1)^2. This means that the center has been updated from (0,0) to (2, -1). But the radius stays the same, since the right side is still 4. Thus the circle has gotten shifted.
Similarly, you can update these values to move the circle to your desired location.
Step 3: Morph the circle into an ellipse
Now, we are going to modify the equation in a subtle manner. For the “x” term, we are going to go back to x^2. But for the “y” term, we are going to modify it as show below:
What has happened so far? You can see that “y” by not having a fixed center, the shape has morphed into an ellipse.
Furthermore, if you look at the right side of the ellipse, i.e the portion to the right of the y-axis, it starts to look like a heart shaped figure.
Step 4: Create a half-heart figure
We will take the above idea and restrict the graph to only display the right portion:
By adding a square root symbol (which is not defined for negative values of its input), we are restricting the shape to be situated only to the right portion of the y-axis.
Step 5: Convert the half-heart to a full heart
Now we are at the last step. How do we create a mirror reflection of the half heart so we get a full heart? It turns out that is not that difficult.
All we need to do is to add an absolute value symbol. By introducing an absolute value, we ensure that the graph is defined for both negative and positive values of x. Furthermore, by using an absolute value, we ensure that the graph is a mirror image of what you see on the right.
Finally! We have arrived at our heart! Don’t you just love it?
Next time you want to draw a heart, follow these steps starting from a circle and you will be all set!
Kodeclik is an online coding academy for kids and teens to learn real world programming. Kids are introduced to coding in a fun and exciting way and are challeged to higher levels with engaging, high quality content.