boolean findSplitter(double ccw0 , double ccw1 ,
						 EdgeSet master , EdgeSet other1 , EdgeSet other2 ,
						 TupleI32 output ) {

		double bestDistance = Double.MAX_VALUE;

		for (int i = 0; i < master.size(); i++) {
			// select the splitter
			Edge me = master.get(i);

			// TODO decide if this is helpful or not
			// check that it lies between these two angles
			if( UtilAngle.distanceCCW(ccw0 , me.direction) > Math.PI*0.9 ||
					UtilAngle.distanceCW(ccw1,me.direction) > Math.PI*0.9 )
				continue;

			// Find indexes which point towards the splitter corner
			int idxB = other1.find(me.dst);
			if( idxB == -1 )
				continue;

			double thetaB = UtilAngle.distanceCCW(ccw0 , other1.get(idxB).direction);
			if( thetaB < 0.05 )
				continue;

			int idxC = other2.find(me.dst);
			if( idxC == -1 )
				continue;

			double thetaC = UtilAngle.distanceCW(ccw1 , other2.get(idxC).direction);
			if( thetaC < 0.05 )
				continue;

			// want it to be closer and without parallel lines
			double error = me.distance/(0.5+Math.min(thetaB,thetaC));

			if( error < bestDistance ) {
				bestDistance = error;
				output.a = i;
				output.b = idxB;
				output.c = idxC;
			}
		}

		// Reject the best solution if it doesn't form a convex quadrilateral
		if( bestDistance < Double.MAX_VALUE ) {
			// 2 is CCW of 1, and since both of them are pointing towards the splitter we know
			// how to compute the angular distance
			double pointingB = other1.edges.get(output.b).direction;
			double pointingC = other2.edges.get(output.c).direction;
			return UtilAngle.distanceCW(pointingB, pointingC) < Math.PI;
		} else {
			return false;
		}
	}
boolean findSplitter ( double ccw0 , double ccw1 , EdgeSet master , EdgeSet other1 , EdgeSet other2 , TupleI32 output ) { double bestDistance = Double . MAX_VALUE ; for ( int i = 0 ; i < master . size ( ) ; i ++ ) { Edge me = master . get ( i ) ; if ( UtilAngle . distanceCCW ( ccw0 , me . direction ) > Math . PI * 0.9 || UtilAngle . distanceCW ( ccw1 , me . direction ) > Math . PI * 0.9 ) continue ; int idxB = other1 . find ( me . dst ) ; if ( idxB == - 1 ) continue ; double thetaB = UtilAngle . distanceCCW ( ccw0 , other1 . get ( idxB ) . direction ) ; if ( thetaB < 0.05 ) continue ; int idxC = other2 . find ( me . dst ) ; if ( idxC == - 1 ) continue ; double thetaC = UtilAngle . distanceCW ( ccw1 , other2 . get ( idxC ) . direction ) ; if ( thetaC < 0.05 ) continue ; double error = me . distance / ( 0.5 + Math . min ( thetaB , thetaC ) ) ; if ( error < bestDistance ) { bestDistance = error ; output . a = i ; output . b = idxB ; output . c = idxC ; } } if ( bestDistance < Double . MAX_VALUE ) { double pointingB = other1 . edges . get ( output . b ) . direction ; double pointingC = other2 . edges . get ( output . c ) . direction ; return UtilAngle . distanceCW ( pointingB , pointingC ) < Math . PI ; } else { return false ; } }
Splitter is a vertex that has an angle between two edges being considered.

@param ccw0 angle of edge 0
@param ccw1 angle of edge 1
@param master Set of edges that contains all potential spitters
@param other1 set of perpendicular edges to vertex ccw0
@param other2 set of perpendicular edges to vertex ccw1
@param output index of indexes for edges in master, other1, other2
@return true if successful