This file is great, however there seem to be a problem with colinear points. I got an error message while testing for :
x = [0.25; 0.75; 0.25; 0.75];
y = [0.25; 0.25; 0.75; 0.75];
Thank you for your comment.
To answer your question, the function aims to compute the individual Voronoi cell area of point sets BOUNDED in an arbitrary square.
However, from your inputs, you have a x-input (5.0000,5.0000) which lies outside of your square boundary [0 1 0 1], hence will result in incorrect cell area computation.
You can either opt to have all your x and y points inside the square [0 1 0 1] or introduce a larger boundary, e.g. [0 5 0 5], so that it encapsulates your third point (5.0000, 5.0000).
Hope it helps.
It seems this function has some bugs in it. With input
x = 0.5000 y= 0.3333
and corners = [0 1 0 1] it gives me [4997 0 0]. This, clearly is not correct, as the two first points should have roughly half each of the specified area. Or perhaps I don't understand the interface correctly. Also, the documentation is rather sparse for this code. Thanks, though for a great effort. This is the only code I could find that attempts this.