core/connection_db.js
function checkConnection_(yIndex) {
    var dx = currentX - db[yIndex].x_;
    var dy = currentY - db[yIndex].y_;
    var r = Math.sqrt(dx * dx + dy * dy);
    if (r <= maxRadius) {
      neighbours.push(db[yIndex]);
    }
    return dy < maxRadius;
  }
function checkConnection_(yIndex) {
    var dx = currentX - db[yIndex].x_;
    var dy = currentY - db[yIndex].y_;
    var r = Math.sqrt(dx * dx + dy * dy);
    if (r <= maxRadius) {
      neighbours.push(db[yIndex]);
    }
    return dy < maxRadius;
  }
function checkConnection_ ( yIndex ) { var dx = currentX - db [ yIndex ] . x_ ; var dy = currentY - db [ yIndex ] . y_ ; var r = Math . sqrt ( dx * dx + dy * dy ) ; if ( r <= maxRadius ) { neighbours . push ( db [ yIndex ] ) ; } return dy < maxRadius ; }
Computes if the current connection is within the allowed radius of another
connection.
This function is a closure and has access to outside variables.
@param {number} yIndex The other connection's index in the database.
@return {boolean} True if the current connection's vertical distance from
the other connection is less than the allowed radius.
Computes if the current connection is within the allowed radius of another connection . This function is a closure and has access to outside variables .