AcademiaAgriculture & FarmingHumanitiesSocial SciencesSTEM

Drawing Hearts on a Graphing Calculator

Updated on June 09, 2016
calculus-geometry profile image

TR Smith is a product designer and former teacher who uses math in her work every day.

Three-strand braided heart with its polar coordinate equation. (Created by the author using the free online calculator Desmos.)
Three-strand braided heart with its polar coordinate equation. (Created by the author using the free online calculator Desmos.)

There are many ways to draw a heart on a graphing calculator, but the best technique is with either parametric equations or polar coordinate equations, since you can trace out the shape of symmetric heart with a single function. Parametric equations have the form {x(t), y(t)} and polar equations have the form r(θ).

It is also possible to draw a heart on a graphing calculator using rectangular coordinate equations of the form y = f(x). However, you have to piece together several different functions and figure out where they intersect. This is more work, and the results are not as smooth.

The TI-84 is the most commonly used graphing calculator, but these heart equations will work for any graphing calculator model, even an online graphing calculator. If you use an online graphing calculator, you can print your heart designs to make coloring pages, or save the images as a png, jpg or gif files. No advanced mathematical knowledge is needed to draw these heart equations; they are "plug-and-chug" ready to input on a graphing calculator. All you need to do is change the "Mode" settings to parametric or polar and possibly adjust the viewing window settings.

The heart graphs below were made using the free online graphing calculators FooPlot and Desmos, and equations I came up with by trial and error.

Click thumbnail to view full-size
Press the "MODE" key to switch to polar or parametric coordinates, "POL or "PAR."  The default is rectangular, "FUNC." (TI-84 screen shot)How the TI-84 screen looks when you hit "Y=" and "Window" in polar mode. (TI-84 screen shot)How the TI-84 screen looks when you hit "Y=" and "Window" in parametric mode. (TI-84 screen shot)
Press the "MODE" key to switch to polar or parametric coordinates, "POL or "PAR."  The default is rectangular, "FUNC." (TI-84 screen shot)
Press the "MODE" key to switch to polar or parametric coordinates, "POL or "PAR." The default is rectangular, "FUNC." (TI-84 screen shot)
How the TI-84 screen looks when you hit "Y=" and "Window" in polar mode. (TI-84 screen shot)
How the TI-84 screen looks when you hit "Y=" and "Window" in polar mode. (TI-84 screen shot)
How the TI-84 screen looks when you hit "Y=" and "Window" in parametric mode. (TI-84 screen shot)
How the TI-84 screen looks when you hit "Y=" and "Window" in parametric mode. (TI-84 screen shot)

Preliminary: Working With Your Graphing Calculator

To graph these equations, you need switch the default function entry method to parametric or polar coordinates. To switch it on a TI-84 graphing calculator, hit the "Mode" key and highlight "PAR" or "POL" on the screen, then hit enter and quit.

Now when you hit the "Y=" key to enter your equations, you should see X1T= and Y1T= for parametric coordinates, and r1= for polar. The "X,T,θ,n" key provides the independent variable you need to input the function -- T for parametric and θ for polar. Press the "Window" key change the range for T and θ; the defaults are 0 to 2π.

Parametric Heart Equations: Basic Formulas

Click thumbnail to view full-size
Classic heartShifted heartShifted heartSpirograph heartScribble heartCandy heartSpirograph heartLopsided heart
Classic heart
Classic heart
Shifted heart
Shifted heart
Shifted heart
Shifted heart
Spirograph heart
Spirograph heart
Scribble heart
Scribble heart
Candy heart
Candy heart
Spirograph heart
Spirograph heart
Lopsided heart
Lopsided heart

With parametric equations, the x-coordinate and y-coordinate of every point on the curve is given by a function of another variable, usually called t. To make heart-shaped curves in parametric coordinates, x(t) and y(t) need to be periodic functions, such as trig functions. This ensures that the curve will close on itself. To make an upright heart, use equations of the form

x(t) = A*sin(t) + B*sin(2t) + C*sin(3t) + ...

y(t) = D*cos(t) + E*cos(2t) + F*cos(3t) + ...

where A, B, C, D, E, F, ... are some coefficients that can be positive or negative. If you play around with the coefficients you can get it to curve the way you want. Some examples of parametric heart equations are shown in the gallery above. You can vary the coefficients in these equations to see how the shape of the heart changes.

To make a heart with woven or spiralling effects, you need to include terms of the form sin[(p/q)t] and/or cos[(p/q)t], where p/q is a rational number that is not an integer. If you include these terms, you also need to change your viewing window so that t ranges from 0 to 2qπ. The default window setting is 0 ≤ t ≤ 2π.

To make a lopsided or asymmetric heart, include cosine terms in the equation x(t), and/or sine terms in the equation y(t).

Polar Heart Equations: Basic Formulas

Click thumbnail to view full-size

As with parametric heart equations, polar heart equations also require periodic functions to ensure that the curve ends where it begins. To make an upright heart in polar equations, you should use equations with the basic trigonometric form

r(θ) = A + Bsin(θ) + Csin(3θ) + D*|cos(θ)| + E*cos(2θ),

where A, B, C, D, and E are numbers that can be positive or negative. If you vary the coefficients you will get different heart shapes.

To get a concave S-curving point like some of the hearts in the gallery above, the equation needs a term of the form |cos(θ)|^F, where F is some non-integer, for example, F = 0.5. The expression |cos(θ)|^0.5 is the same as the square root of |cos(θ)|. A variety of basic equations are shown in the heart equation gallery above.

Special Effects Heart Equations in Polar Coordinates

Click thumbnail to view full-size
Woven heartFuzzy heartSplit heartDouble heartWide-lobed heartWide-lobed heartBunny ears heartLopsided heartFlaming heartDouble heart
Woven heart
Woven heart
Fuzzy heart
Fuzzy heart
Split heart
Split heart
Double heart
Double heart
Wide-lobed heart
Wide-lobed heart
Wide-lobed heart
Wide-lobed heart
Bunny ears heart
Bunny ears heart
Lopsided heart
Lopsided heart
Flaming heart
Flaming heart
Double heart
Double heart

To make hearts with decorative effects, you have to vary the basic forms. For example, to trace out a woven heart, you need a term of the form sin[(p/q)θ] or cos[(p/q)θ], where p/q is a rational number that is not an integer. The larger the denominator q, the more threads in the weave. The larger the value of p, the tighter the weave. In order for your graphing calculator to trace out the full heart, you must set the θ window value to 0 ≤ θ ≤ 2qπ.

To make a heart with a jagged or fuzzy border, add terms of the form G*sin(nθ) or G*cos(nθ), where G is a relatively small compared to the other coefficients, and n is larger than 30.

To make a lopsided or asymmetric heart, insert terms of the form sin(even*θ) and/or cos(odd*θ), where "odd" and "even" are some odd and even integers.

The double heart in the last image is generated from the |sin(2θ)| terms included in the equation.

Play around with different equation forms to see what other kinds of interesting heart curves you can draw on a graphing calculator.

Rectangular Coordinates Heart

Basic Rectangular Coordinate Heart, Piece-wise Curve
Basic Rectangular Coordinate Heart, Piece-wise Curve
Five equations that generate a heart in Cartesian coordinates
Five equations that generate a heart in Cartesian coordinates

To make a heart in rectangular or Cartesian coordinates, you need to patch together lines and arcs of curves, such as parabolas, circles, ellipses, or hyperbolas. The heart will look best if the straight line segments are tangent to the curves where they meet, thus you might have to use some calculus to figure out the right equation.

With a circular arcs, you don't need calculus to match up the various curves, you can use basic properties of circles. For example, if you draw a line from the center of a circle to the circumference -- a radius -- the tangent line at that point on the circumference is perpendicular to the radius.

Using this fact, you can make a simple heart by affixing two half circles to adjacent sides of a square, choosing the radius of the circles equal to the side lengths of the square. One example is shown in the image above, along with its five equations.

One tricky aspect of constructing hearts with rectangular coordinate functions is that a function can only pass through one y value for each x value. So if you are using circles, you have to separately enter the top and bottom halves. Another tricky part is figuring out what the radii of the circles should be and where the centers are. If you know the radius r and the center point (a, b), then the top and bottom halves of the circle are given by the equations

y upper = sqrt[ r^2 - (x-a)^2 ] + b
y lower = -sqrt[ r^2 - (x-a)^2 ] + b

Comments

    0 of 8192 characters used
    Post Comment

    • profile image

      bfilipek 3 years ago

      cool! :)

    • profile image

      bryn 22 months ago

      thanks for these easy instructions, i just learned about polar coordinates. what equations do i need to draw nested hearts on a graphing calculator?

    • calculus-geometry profile image
      Author

      TR Smith 16 months ago from Eastern Europe

      Thanks PZ, looks great.

    • profile image

      Andrea 7 weeks ago

      Amazing! Thank you for this. My students are doing a Valentine's Day project with this. Fun!

    Click to Rate This Article