Jump to content

Voronoi diagram: Difference between revisions

(add Ruby)
Line 586:
 
def distance_to(px, py)
Math::sqrt( hypot(px - x)**2, + (py - y)**2 )
end
end
Line 597:
ColourPixel.new(
3+rand(width-6), 3+rand(height-6), # provide a margin to draw a circle
RGBColour.new(rand(255256), rand(255256), rand(255256))
)
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.