ToolSphere
All Desmos art

Desmos Christmas Tree Equations

Three overlapping triangles make the branches, a rectangle makes the trunk, a five-pointed star sits on top, and small circles are the ornaments.

Christmas tree drawn from its Desmos equations
29 equations, t from 0 to 1

The picture above is drawn from exactly these equations. Paste them into the first empty line of the Desmos graphing calculator; each line becomes its own curve.

How it is built

Tiers. Each tier is a triangle: three straight segments, each written (x₀ + (x₁ − x₀)t, y₀ + (y₁ − y₀)t). The tiers get narrower and higher: bases at y = −2, 0 and 2, half-widths 4, 3.2 and 2.4, each 3.5 tall, so they overlap like real branches.

Star. The same star as the star drawing, shrunk to a tip radius of 0.9 and moved to (0, 6) by adding 6 to every y.

Ornaments. Small circles, (h + 0.25cos(2πt), k + 0.25sin(2πt)). Each one is placed so it sits inside its tier: at height y, a tier with base b, half-width w and height 3.5 is w × (b + 3.5 − y) ÷ 3.5 wide on each side.

Press Copy all equations, open the Desmos graphing calculator, click into the first empty expression line and paste: each line becomes its own curve. Every curve uses t from 0 to 1, which is Desmos's default, so there is nothing to set up. Fill the ornaments and the star for a brighter tree.

Make your own

Frequently asked questions

How do I draw a Christmas tree in Desmos?

Stack three triangles that get smaller as they go up, add a rectangle for the trunk and a star on top. The equations on this page paste straight into Desmos.

How do I add more ornaments?

Copy an ornament line and change its centre: (h + 0.25cos(2πt), k + 0.25sin(2πt)). Keep (h, k) inside a tier so it sits on the branches.

How do I move the star?

Add the same number to every y in the star's ten lines (or every x to move it sideways).