ToolSphere
Back to all articles
student

Desmos Heart Equations: 4 Ways to Draw

2026-11-128 min read

Try it: free Name in Desmos

Turn your name into equations that draw it in Desmos

Open →

Drawing a heart in the Desmos graphing calculator is one of the most rewarding graph-art projects for math students, teachers, and makers. Whether you need a quick curve for a Valentine greeting card, a homework demonstration of parametric functions, or a centerpiece for a multi-equation illustration, mathematics offers several elegant ways to construct a heart.

Different mathematical formulations offer different advantages. Some equations plot in a single copy-and-paste line, others allow instant solid shading with inequalities, and multi-curve constructions let you combine smooth curves with straight lines and lettering.

This guide details four distinct methods to create a heart in Desmos:

  1. The Parametric Sin³ Heart: The classic smooth curve with symmetric lobes and a sharp lower point.
  2. The Polar Cardioid: The natural geometric curve based on rolling circles.
  3. The Implicit Algebraic Heart: A single polynomial equation in x and y that shades solid with an inequality.
  4. The Valentine Art Piece: The ready-to-paste parametric drawings quoted directly from the ToolSphere art gallery, designed with open centers for initials and lettering.

Method 1: The Parametric Sin³ Heart

The most widely recognized mathematical heart curve is defined by a pair of parametric equations where both x and y depend on a continuous parameter t.

Standard Textbook Form (0 ≤ t ≤ 2π):
x(t) = 16 sin³(t)
y(t) = 13 cos(t) − 5 cos(2t) − 2 cos(3t) − cos(4t)

In Desmos, parametric curves are entered as an ordered pair (x(t), y(t)). When you type the variable t, Desmos automatically recognizes the expression as a parametric curve and provides input boxes for the parameter interval, which defaults to 0 ≤ t ≤ 1.

To make the curve plot seamlessly without needing to adjust the parameter bounds to 2π, you can normalize the angle using 2πt:

Desmos Copy-and-Paste Line (Default 0 ≤ t ≤ 1):
(8sin(2πt)^3, 6.5cos(2πt) − 2.5cos(4πt) − cos(6πt) − 0.5cos(8πt))

How the Mathematics Works

The parametric heart relies on two distinct mathematical mechanisms:

  1. Horizontal Shaping via sin³(t): A standard sine function sin(t) swings smoothly between −1 and 1. Cubing the sine compresses values near zero and expands values near the peaks. As t sweeps through the cycle, sin³(t) keeps the curve narrow near the vertical center line and flares outward toward the shoulders, creating the rounded lobes and the lower pinch.
  2. Vertical Modulation via a Cosine Fourier Series: The vertical coordinate is a weighted sum of four harmonic cosine frequencies:
    • 6.5 cos(2πt) establishes the primary vertical span and baseline height.
    • −2.5 cos(4πt) runs at double frequency. At t = 0 and t = 1, it pulls the top of the curve downward, carving the deep central notch.
    • −cos(6πt) and −0.5 cos(8πt) add higher-frequency harmonics that round the upper humps and taper the lower contour into a clean V-shaped tip.

Key Coordinates Along the Path

Evaluating the curve at quarter intervals illustrates how the path travels:

  • At t = 0 (or t = 1): x = 0, y = 6.5 − 2.5 − 1 − 0.5 = 2.5. The curve starts at the top central notch.
  • At t = 0.25: sin(π/2) = 1, so x = 8. The cosines evaluate to 0 + 2.5 − 0 − 0.5 = 2.0. This defines the wide crest of the right lobe at (8, 2.0).
  • At t = 0.5: sin(π) = 0, so x = 0. The cosines evaluate to −6.5 − 2.5 + 1 − 0.5 = −8.5. This forms the sharp bottom point at (0, −8.5).
  • At t = 0.75: sin(3π/2) = −1, so x = −8 and y = 2.0, marking the peak of the left lobe at (−8, 2.0).

To fill this heart in Desmos, click the colored circle or gear icon next to the expression line, check the Fill box, and select red or pink.


Method 2: The Polar Cardioid

The cardioid is the original mathematical heart curve, deriving its name directly from the Greek word kardia (heart).

In geometry, a cardioid is generated by tracing the path of a single point on the rim of a circle as it rolls without slipping around a fixed circle of identical radius. In polar coordinates, where r represents the distance from the origin and θ represents the angle, the cardioid has an exceptionally simple equation.

Standard Polar Cardioid:
r = 1 − sin(θ)

Entering in Desmos

To graph a polar equation in Desmos:

  1. Click into a blank expression line.
  2. Type r = 1 - sin(theta). Desmos automatically turns theta into the Greek symbol θ and configures the domain to 0 ≤ θ ≤ 2π.
  3. To scale the heart larger, multiply the right side by a constant: r = 4(1 - sin(theta)).
Desmos Expressions to Try:
r = 3(1 − sin(θ))    (Cleft points downward at the origin)
r = 3(1 + sin(θ))    (Inverted: cleft points upward)

Understanding the Cusp

At θ = π/2 (90 degrees), sin(θ) = 1, which gives r = 1 − 1 = 0. The distance from the center drops to zero, producing the sharp indentation (cusp) of the cardioid. At θ = 3π/2 (270 degrees), sin(θ) = −1, giving r = 1 − (−1) = 2, creating the broad opposite lobe.

Sharpened Polar Heart Variation

A basic cardioid has a rounded base rather than a pointed tip. If you want a more anatomical heart silhouette in polar coordinates, you can add an absolute-value cosine term to sharpen both lobes and the base:

Sharpened Polar Heart:
r = 2 − 2sin(θ) + (sin(θ) · √(│cos(θ)│)) / (sin(θ) + 1.4)

In Desmos, enter this expression directly:

r = 2 - 2sin(θ) + (sin(θ)*sqrt(|cos(θ)|))/(sin(θ) + 1.4)

The square root of the absolute cosine flares the upper lobes while tapering the lower point, giving a recognizable heart profile within a single polar expression.


Method 3: The Implicit Algebraic Heart

If you want a single equation using standard Cartesian coordinates (x and y) that can be shaded solid red using a simple inequality, the implicit algebraic heart is the premier choice.

Implicit Heart Equation:
(x² + y² − 1)³ − x²y³ = 0
Desmos Copy-and-Paste Line:
(x^2 + y^2 - 1)^3 - x^2*y^3 = 0

How the Algebra Shapes the Curve

This formula is a cross-section of Gabriel Taubin's algebraic heart surface. Its behavior becomes clear when broken into two parts:

  1. The Base Circle: The term (x² + y² − 1) is the implicit equation for a unit circle with radius 1 centered at (0, 0). When squared or cubed, it evaluates to zero along the circle's perimeter, negative inside, and positive outside.
  2. The Deformation Term −x²y³: This cubic term distorts the circle into a heart depending on the sign of y:
    • Upper Half (y > 0): Because y is positive, y³ > 0. Since x² is positive everywhere (except at x = 0), the product x²y³ is positive. To balance the equation to zero, (x² + y² − 1)³ must also be positive. This forces the boundary outward beyond the unit circle, expanding to a maximum horizontal width of x ≈ ±1.14 near y ≈ 0.55 to form the twin upper lobes. Exactly along the center line (x = 0), x²y³ = 0, so the curve passes through (0, 1), creating the central notch.
    • Lower Half (y < 0): Because y is negative, y³ < 0. Multiplying by −x² makes −x²y³ positive. To balance the equation to zero, (x² + y² − 1)³ must become negative, pulling the boundary inward and downward until it converges to a sharp cusp at (0, −1).

How to Shade the Heart Solid

One of the greatest features of this implicit equation in Desmos is instant shading. Replace the equals sign (=) with less-than-or-equal-to (<=):

Filled Heart Inequality:
(x^2 + y^2 - 1)^3 - x^2*y^3 <= 0

Because the expression evaluates to negative values inside the curve, Desmos immediately fills the interior with a smooth solid color.


Method 4: Valentine Art Pieces from the Gallery

The ToolSphere Desmos art gallery contains ready-to-paste drawings that build on these equations, scaled and composed for Valentine cards and personalized graphs. Every curve uses parameter t from 0 to 1, so each line pastes into Desmos and graphs instantly.

Option A: Valentine Heart with Space for Initials

The gallery piece /desmos-art/heart-with-initials-space uses a scaled version of the parametric heart curve, proportioned to leave an open center for custom lettering.

Exact Gallery Equation:
(4.8\sin(2\pi t)^{3},3.9\cos(2\pi t)-1.5\cos(4\pi t)-0.6\cos(6\pi t)-0.3\cos(8\pi t))
Desmos Pasteable Text:
(4.8sin(2πt)^3, 3.9cos(2πt) − 1.5cos(4πt) − 0.6cos(6πt) − 0.3cos(8πt))

This curve scales the horizontal coordinate to ±4.8 and the vertical span from +1.5 at the notch to −5.1 at the tip. The open center is designed specifically to pair with Name in Desmos.

To add your initials:

  1. Open Name in Desmos.
  2. Type two initials (such as "A + B" or "J & M").
  3. Copy the generated letter equations and paste them into the same Desmos graph.
  4. Scale or shift the letter curves so they sit comfortably inside the heart outline.

Option B: Two Linked Valentine Hearts

The gallery piece /desmos-art/linked-hearts pairs two matching heart curves with horizontal offsets to create an overlapping Valentine monogram.

Exact Gallery Equations:
(-1.7+2.6\sin(2\pi t)^{3},2.1\cos(2\pi t)-0.8\cos(4\pi t)-0.3\cos(6\pi t)-0.15\cos(8\pi t))
(1.7+2.6\sin(2\pi t)^{3},2.1\cos(2\pi t)-0.8\cos(4\pi t)-0.3\cos(6\pi t)-0.15\cos(8\pi t))
Desmos Pasteable Lines:
(-1.7 + 2.6sin(2πt)^3, 2.1cos(2πt) − 0.8cos(4πt) − 0.3cos(6πt) − 0.15cos(8πt))
(1.7 + 2.6sin(2πt)^3, 2.1cos(2πt) − 0.8cos(4πt) − 0.3cos(6πt) − 0.15cos(8πt))
  • The left heart is shifted left by subtracting 1.7 from the x-coordinate.
  • The right heart is shifted right by adding 1.7 to the x-coordinate.
  • In Desmos, set the first expression line to red and the second to purple to make the overlapping loop design easy to follow.

Option C: Valentine Heart with an Arrow

The gallery piece /desmos-art/heart-with-arrow combines the parametric heart outline with seven straight parametric line segments that construct a diagonal arrow with arrowhead and fletching feathers.

Exact Gallery Equations:
(4.8\sin(2\pi t)^{3},3.9\cos(2\pi t)-1.5\cos(4\pi t)-0.6\cos(6\pi t)-0.3\cos(8\pi t))
(-6+12t,-3.6+7.2t)
(4+2t,3.4+0.2t)
(6-1.1t,3.6-1.7t)
(-5.6,-3.36+1.46t)
(-5.6+1.4t,-3.36-0.44t)
(-4.9,-2.94+1.44t)
(-4.9+1.4t,-2.94-0.46t)

The first line draws the red heart outline. The remaining seven lines use linear parameter equations of the form (x₀ + Δx·t, y₀ + Δy·t) to draw the shaft from (−6, −3.6) to (6, 3.6), the arrowhead at the top right, and two pairs of feathers at the bottom left.


Comparison of Heart Methods

Method Equation Type Expression Count Shading Support Best Application
Parametric Sin³ Parametric (x(t), y(t)) 1 line Desmos Fill toggle Classic outline, animated pulsing
Polar Cardioid Polar r = f(θ) 1 line Standard stroke Geometry and calculus demonstrations
Implicit Algebraic Polynomial f(x, y) = 0 1 line Inequality <= 0 Solid shaded hearts, algebra homework
Initials Valentine Heart Parametric (x(t), y(t)) 1 line Desmos Fill toggle Personalized cards with Name to Desmos
Linked Hearts Multi-curve Parametric 2 lines Two color strokes Double initials, couple monograms
Heart with Arrow Parametric + Lines 8 lines Mixed colors Complete Valentine graphic art

Tips for Styling and Animating Hearts in Desmos

1. Make a Beating Heart Animation

You can turn any parametric heart into a pulsing heartbeat animation using a slider variable.

Add a slider variable a in Desmos and set its range from 0.85 to 1.15. Then multiply both coordinates by a:

Beating Heart Expression:
(a · 8sin(2πt)^3, a · (6.5cos(2πt) − 2.5cos(4πt) − cos(6πt) − 0.5cos(8πt)))

Click the Play button on slider a and set the animation mode to oscillate. The heart will smoothly expand and contract on your screen.

2. Moving and Resizing Hearts

To place a heart anywhere on the coordinate grid, apply standard transformation rules:

  • Horizontal Shift: Add h to the x-coordinate: (h + x(t), y(t)).
  • Vertical Shift: Add k to the y-coordinate: (x(t), k + y(t)).
  • Uniform Scaling: Multiply both coordinates by scale factor s: (s · x(t), s · y(t)).

For implicit hearts, replace x with (x − h)/s and y with (y − k)/s:

Shifted and Scaled Implicit Heart:
(((x − h)/s)² + ((y − k)/s)² − 1)³ − ((x − h)/s)² · ((y − k)/s)³ ≤ 0

3. Custom Color Palettes

Desmos offers default colors (red, blue, green, orange, purple, and black). In modern Desmos, you can also define custom RGB colors using the rgb() function on a separate line:

c_pink = rgb(255, 105, 180)
c_crimson = rgb(220, 20, 60)

Assign your custom color variable to any curve or shading layer to give your graph project a refined look.


Frequently Asked Questions

What is the easiest heart equation to type into Desmos?

The implicit heart equation (x^2 + y^2 - 1)^3 - x^2*y^3 = 0 is the fastest single equation to type. It uses standard x and y variables and requires no special parameter ranges or angle setups.

How do I fill in or shade a heart in Desmos?

For implicit equations, replace = with <=: (x^2 + y^2 - 1)^3 - x^2*y^3 <= 0. For parametric curves, click the colored circle or gear icon beside the expression in Desmos and toggle the Fill setting on.

Why does the parametric heart equation use a cubed sine?

Cubing the sine compresses values near zero and expands values near ±1. This narrows the curve near the vertical axis while flaring the outer lobes, creating the distinctive notch and point of a heart.

Can I write names or initials inside my Desmos heart?

Yes. The easiest workflow is to copy the outline from /desmos-art/heart-with-initials-space, then use Name in Desmos to generate equation strokes for your letters and paste them into the same graph.

What is the difference between a cardioid and a heart curve?

A cardioid is a mathematically pure epicycloid generated by a rolling circle. It has one sharp cusp and one broad, rounded opposite end. A standard heart curve modifies this shape to include two rounded upper lobes and a pointed lower tip.

How do I make the heart beat or pulse in Desmos?

Multiply the coordinates of your parametric equation by a slider variable a: (a · 8sin(2πt)^3, a · (...)). Configure slider a between 0.9 and 1.1 and press the play button to animate the heartbeat.

Why does my polar cardioid look sideways or upside down?

The orientation of a polar curve depends on the trigonometric function. r = 1 − sin(θ) places the cusp at the origin pointing down, r = 1 + sin(θ) points the cleft up, and r = 1 − cos(θ) points the cusp horizontally along the x-axis.

Can I change the line thickness of the heart in Desmos?

Yes. Long-click or click the gear icon next to the expression line in Desmos. You can adjust the line width slider from its default 2.5 to any thickness, or adjust the opacity between 0 and 1.

Can I export my Desmos heart drawing as an image?

Yes. Click the Share Graph button (the arrow icon in the top right corner of Desmos) and select Export Image. You can choose your desired dimensions, line thickness, and download a PNG or SVG.

Use the Drawing to Equations to turn a sketch into equations for your graph-art project. For a related walkthrough, read Desmos Graph Art: How to Draw With Equations.

Looking for other tools?

Explore ToolSphere Homepage →