getCurrentCenterOfMassInNeigbourhood(vec, r = this.opts.bondLength * 2.0) {
    let total = new Vector2(0, 0);
    let count = 0;
    let rSq = r * r;

    for (var i = 0; i < this.graph.vertices.length; i++) {
      let vertex = this.graph.vertices[i];

      if (vertex.positioned && vec.distanceSq(vertex.position) < rSq) {
        total.add(vertex.position);
        count++;
      }
    }

    return total.divide(count);
  }
Returns the current (positioned vertices so far) center of mass in the neighbourhood of a given position.

@param {Vector2} vec The point at which to look for neighbours.
@param {Number} [r=currentBondLength*2.0] The radius of vertices to include.
@returns {Vector2} The current center of mass.