I've been looking at this javascript implementation of Fortune's algorithm to calculate Voronoi diagrams:
http://www.raymondhill.net/voronoi/rhil ... -demo1.php
I'm trying to wrap my mind around the implementation, which is available on Github here. It has no dependencies, supposedly.
https://github.com/gorhill/Javascript-V ... oi-core.js
I understand object-oriented programming concepts, but I'm not familiar with implementing them in javascript and I'm not well versed with js, so I'm trying to work out what's happening.
Around line 189 is the following:
root is never declared as a function or variable, though it is part of a tree structure. How can it be used without being declared?
http://www.raymondhill.net/voronoi/rhil ... -demo1.php
I'm trying to wrap my mind around the implementation, which is available on Github here. It has no dependencies, supposedly.
https://github.com/gorhill/Javascript-V ... oi-core.js
I understand object-oriented programming concepts, but I'm not familiar with implementing them in javascript and I'm not well versed with js, so I'm trying to work out what's happening.
Around line 189 is the following:
Code:
Voronoi.prototype.RBTree = function() {
this.root = null;
};
root is never declared as a function or variable, though it is part of a tree structure. How can it be used without being declared?