✧ Universe at Play
A small programming adventure · Harmonic Law

Build the Flower Yourself

Two circles. Two moving dots. One connecting line. Start with a flower made by Kepler's law—and discover that you can make the mathematics move with your own code.

Watch itChange itCode itInvent something new

✧   Your mathematical canvas

Venus and Earth—two circular orbital rhythms.

Planet links
Your code makes this picture
100%

Change a number, press Run my code, and watch what happens.

⌘   Your code, your rules

The code is real JavaScript. No special language invented for this lab.

Beginner friendly

Begin with the flower, then graduate to something completely different:

Return two moving points [x₁, y₁, x₂, y₂]

Try changing Venus's orbital radius from 0.723 to 0.8. The beautiful flower changes. Why?

Your program runs in a separate, restricted calculation frame with a time limit. You can experiment freely, but don't paste unfamiliar code from other people.

The physics underneath

One law. So many patterns.

T² ∝ r³

Kepler's third law connects the orbital period T with orbit size r for bodies orbiting the same central mass.

For circular orbits, angular speed is proportional to r−3/2. In our chosen units, that's just 1 / r**1.5.

The flower is a visualization of two different rhythms moving together, not a mystical force. It almost repeats after roughly eight Earth years.
Your first experiments

What if I change a rule?

1Change 0.723 to 0.80. Does the flower gain or lose its petals?
2Replace r**1.5 with r**1. That's no longer Kepler's law—what does it draw?
3Open the Lissajous example. Change its 3 to a 5 and run it.
4Make up your own rule for a point's x and y. What picture will your formula paint?
“In learning, a wrong turn is really a right turn about to happen.”If a change gives you a surprising result, investigate it. The unexpected patterns might teach you something.
Graduate from this flower

Anything with a rule can become a picture.

Once you can compute a position from time, you can plot its journey. You can make pendulums, wave patterns, epicycles, spirals, or shapes that nobody has named yet.

Some systems have convenient formulas. Others need a computer to solve equations step by step, like our gravitational labs.

The big idea: describe what changes → calculate positions → draw them → ask a new question. That's a genuine route into both programming and science.

Scientific note: this first example uses ideal circular Kepler orbits, not a high-precision solar-system ephemeris. The other presets are mathematical patterns, not claims about planetary orbits.

Want the absolute simplest starting point? Open the tiny two-circles, one-line HTML program →