rougier/gallery — pull request #1 by MichaMucha (2014-03-29 21:59:32+00:00)
Title: circumcircle fix

Dear Friends,
I am very grateful to you for putting this script up here for everybody to use.

I used it with geographical locations to display the Voronoi tessellation on a map. I encountered trouble with the circumcircle function in the special case when two of the three points would be on the X or Y axis. For example:
p1 = (10, 15)
p2 = (13, 15)
p3 = (11, 10)
would not generate a polygon, because a division by 0 would happen in the algorithm.

The small adjustment I made resolves this issue. Please see if you can add it to the main branch. Perhaps you can come up with a more elegant solution.

Best wishes
Michal