Dlaczego jedno mnożenie rysuje serce
Połącz każdy punkt n z punktem n × k na okręgu. Jedno mnożenie rysuje kardioidę i jej kuzynki.
Film gra z YouTube po kliknięciu.
Spróbuj: zmień regułę
Razy 2: kardioida, jedno ostrze.
Dlaczego to działa
Postaw 200 punktów na okręgu i połącz każdy punkt n z punktem n × 2. Każda linia trzyma się tej samej reguły, a razem obrysowują krzywą w kształcie serca, kardioidę. Zmień mnożnik, a pojawi się nowy kształt.
punkt n → punkt (k · n) mod Ncałkowite k → epicykloida z k − 1 ostrzami
Zbuduj to w Pythonie
Python 3 · numpy · matplotlib200 punktów, każdy połączony ze swoim podwojeniem: kardioida.
"""Times table on a circle: N dots, each dot n joined to dot (k * n) mod N.
Run: python times-table.py (needs: pip install numpy matplotlib)
"""
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("dark_background")
N, k = 200, 2 # the number of dots and the multiplier
start = 2 * np.pi * np.arange(N) / N # dot n at the angle 2*pi*n/N
end = start * k # dot k*n: angles wrap around the circle by themselves (that is the "mod N")
plt.figure(figsize=(6, 6))
for a, b in zip(start, end):
plt.plot([np.cos(a), np.cos(b)], [np.sin(a), np.sin(b)], color="#f5c76b", linewidth=0.6)
plt.axis("equal")
plt.axis("off")
plt.show()
# Try: k = 3 for the nephroid, k = 101 to see it collapse into diameters
Spróbuj: Ustaw k = 3, żeby zobaczyć nefroidę, albo k = 101: obraz zapada się w same średnice.
Poznaj ten skrypt linijka po linijce, z zadaniami i quizem → · uruchom go w Google Colab (po angielsku) →
Dla nauczycieli: karta lekcji na 45 minut i karta pracy na trzech poziomach →
Matematyka tak, jak opowiada ją film
Pokaż notatki z filmu (z YouTube, po angielsku)
200 points sit evenly around a circle, numbered 0 to 199. One rule draws everything: point n is joined by a straight line to point k·n, counting around the circle and wrapping past 200 (that is k·n mod 200). For k = 2 the envelope of the lines — the curve every one of them just touches — is a cardioid; k = 3 gives a nephroid with two cusps, and in general whole-number k gives an epicycloid with k − 1 cusps. k does not have to be a whole number: the end of each line simply slides along the circle, so the shapes morph into one another as k glides.
The richest flowers appear where k is one away from a simple fraction of 200 (51, 67, 99, 101, 133, 151 …): there the lines almost repeat every few points, and the near-misses pile up into petals. Because only the remainder after dividing by 200 matters, k = 201 sends every point to itself — all 200 lines shrink to nothing — and k = 202 is the cardioid again, exactly where the film began.
Z opisu filmu One Multiplication Rule Draws Every Shape (po angielsku).