/** * Returns true if two loops have the same boundary except for vertex * perturbations. More precisely, the vertices in the two loops must be in the * same cyclic order, and corresponding vertex pairs must be separated by no * more than maxError. Note: This method mostly useful only for testing * purposes. */ internal bool BoundaryApproxEquals(S2Loop b, double maxError) { if (NumVertices != b.NumVertices) { return(false); } var maxVertices = NumVertices; var iThis = _firstLogicalVertex; var iOther = b._firstLogicalVertex; for (var i = 0; i < maxVertices; ++i, ++iThis, ++iOther) { if (!S2.ApproxEquals(Vertex(iThis), b.Vertex(iOther), maxError)) { return(false); } } return(true); }