Jump to content

Voronoi diagram: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 1:
{{task}}
 
A [[wp:Voronoi Diagram|Voronoi Diagram]] is a diagram consisting of a number of sites. Each Voronoi ''s'' also has a Voronoi cell consisting of all points closest to ''s''.
 
=={{header|Python}}==
Line 43:
return voronoi </lang>
=== Sample Output: ===
voronoi = generate_voronoi([(0, 0), (5, 5)]) <br>
voronoi[0] : (0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (0, 2), (1, 2), (2, 2), (3, 2), (0, 3), (1, 3), (2, 3), (0, 4), (1, 4), (0, 5) // Points closest to (0, 0) <br>
voronoi[1] : (5, 1), (4, 2), (5, 2), (3, 3), (4, 3), (5, 3), (2, 4), (3, 4), (4, 4), (5, 4), (1, 5), (2, 5), (3, 5), (4, 5), (5, 5) // Points closest to (5, 5) <br>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.