Théorème des 4 couleurs

Nouveau

Colorier

Testez le théorème des 4 couleurs ! 

Il est en théorie possible de colorier ce puzzle avec seulement 4 couleurs,
de telle sorte qu'aucune pièce n'ait la même couleur qu'une de ses voisines.

Pour essayer, cliquez à proximité des points à l'intérieur des pièces pour 
changer leur couleur, puis appuyer sur le bouton Colorier.

Le bouton Nouveau dessine un nouveau puzzle de 20 pièces.

?

n = 20 (slider from 2 to 20, step 1)
Co1: Corner[1] + (0.1 * (Corner[2] - Corner[1]))
r = 0 (slider from (-rmax) to 0, step 0.01)
A_{1} = (-6.286314415823094, 1.469012562742436)
A_{2} = (-4.237245100842702, -5.17859209401261)
A_{3} = (13.502107411830604, 5.039638677764091)
A_{4} = (1.8660261080924183, 3.09065016370545)
A_{5} = (6.120269343319583, -7.269552852974892)
A_{6} = (-4.423084393983675, 0.28817073400791315)
A_{7} = (-6.9460797842034765, -2.9596426371609477)
A_{8} = (-7.0185995977288735, 0.10251302083642688)
A_{9} = (-7.242992184891364, 3.471921648119147)
A_{10} = (-1.5768374127520985, 2.369007625142637)
A_{11} = (2.8672101820730624, -7.2276708587435605)
A_{12} = (5.618587495674774, 2.394374878697948)
A_{13} = (6.088588693382874, 0.9525383584419194)
A_{14} = (-8.259030127975997, 5.8981934168624806)
A_{15} = (11.688928491577812, -6.757400463754701)
A_{16} = (10.367971662061322, -3.626312132017849)
A_{17} = (4.150659522444737, -3.8807335568954717)
A_{18} = (5.561434520705195, 6.08145384117164)
A_{19} = (-0.5327696981151977, -3.550805674938421)
A_{20} = (1.6253939792547296, -6.3727143694520185)
listecols: {"red", "blue", "green", "yellow"}
v = Voronoi({A_{1}, A_{2}, A_{3}, A_{4}, A_{5}, A_{6}, A_{7}, A_{8}, A_{9}, A_{10}, A_{11}, A_{12}, A_{13}, A_{14}, A_{15}, A_{16}, A_{17}, A_{18}, A_{19}, A_{20}})
c_{1} = Circle(A_{1}, (-r))
c_{2} = Circle(A_{2}, (-r))
c_{3} = Circle(A_{3}, (-r))
c_{4} = Circle(A_{4}, (-r))
c_{5} = Circle(A_{5}, (-r))
c_{6} = Circle(A_{6}, (-r))
c_{7} = Circle(A_{7}, (-r))
c_{8} = Circle(A_{8}, (-r))
c_{9} = Circle(A_{9}, (-r))
c_{10} = Circle(A_{10}, (-r))
c_{11} = Circle(A_{11}, (-r))
c_{12} = Circle(A_{12}, (-r))
c_{13} = Circle(A_{13}, (-r))
c_{14} = Circle(A_{14}, (-r))
c_{15} = Circle(A_{15}, (-r))
c_{16} = Circle(A_{16}, (-r))
c_{17} = Circle(A_{17}, (-r))
c_{18} = Circle(A_{18}, (-r))
c_{19} = Circle(A_{19}, (-r))
c_{20} = Circle(A_{20}, (-r))
rmax = Distance(Co1, Corner[3])
i = 9
col_{1} = Random(1, 4)
col_{2} = Random(1, 4)
col_{3} = Random(1, 4)
col_{4} = Random(1, 4)
col_{5} = Random(1, 4)
col_{6} = Random(1, 4)
col_{7} = Random(1, 4)
col_{8} = Random(1, 4)
col_{9} = Random(1, 4)
col_{10} = Random(1, 4)
col_{11} = Random(1, 4)
col_{12} = Random(1, 4)
col_{13} = Random(1, 4)
col_{14} = Random(1, 4)
col_{15} = Random(1, 4)
col_{16} = Random(1, 4)
col_{17} = Random(1, 4)
col_{18} = Random(1, 4)
col_{19} = Random(1, 4)
col_{20} = Random(1, 4)
col = 1
aide = false
Co4: Corner[4] + (0.1 * (Corner[3] - Corner[4]))
poly1, a, co1, co4, b = Polygon(Corner[1], Co1, Co4, Corner[4])