Por que razão uma multiplicação desenha um coração
Ligue cada ponto n ao ponto n × k num círculo. Uma só multiplicação desenha uma cardioide e as suas primas.
É reproduzido a partir do YouTube depois de um clique.
Experimente: mude a regra
Vezes 2: a cardioide, uma cúspide.
Por que razão funciona
Ponha 200 pontos num círculo e ligue cada ponto n ao ponto n × 2. Cada linha segue a mesma regra e, juntas, desenham o contorno de uma curva em forma de coração, a cardioide. Mude o multiplicador e aparece uma forma nova.
ponto n → ponto (k · n) mod Nk inteiro → uma epicicloide com k − 1 cúspides
Construa-o em Python
Python 3 · numpy · matplotlib200 pontos, cada um ligado ao seu dobro: a cardioide.
"""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
Experimente: Defina k = 3 para ver a nefroide, ou k = 101 para ver a imagem reduzir-se a diâmetros.
Aprenda este script linha a linha, com exercícios e um quiz → · execute-o no Google Colab (em inglês) →
Para professores: um plano de aula de 45 minutos e uma folha de exercícios em três níveis →
A matemática, tal como o filme a conta
Ler as notas do próprio filme (do YouTube, em inglês)
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.
Da descrição de One Multiplication Rule Draws Every Shape (em inglês).