UNPKG

ngraph.quadtreebh

Version:

Quad tree data structure for Barnes-Hut simulation

7 lines (5 loc) 188 B
module.exports = function isSamePosition(point1, point2) { var dx = Math.abs(point1.x - point2.x); var dy = Math.abs(point1.y - point2.y); return (dx < 1e-8 && dy < 1e-8); };