/** * Determines whether this circle is adjacent to another. * * @param circle Circle we're comparing with. */ public boolean adjacentTo(AtroposCircle circle) { return (((Math.abs(this.height - circle.height()) == 1) && (this.leftDistance == circle.leftDistance())) || ((Math.abs(this.leftDistance - circle.leftDistance()) == 1) && (this.height == circle.height())) || ((Math.abs(this.height - circle.height()) == 1) && (this.rightDistance == circle.rightDistance()))); }