main/src/georegression/geometry/UtilPolygons2D_F64.java
public static boolean hasAdjacentDuplicates( Polygon2D_F64 polygon , double tol ) {

		for (int i = polygon.vertexes.size()-1,j=0; i >= 0 && polygon.size()>1; j=i,i--) {
			if( polygon.get(i).isIdentical(polygon.get(j),tol)) {
				return true;
			}
		}
		return false;
	}
public static boolean hasAdjacentDuplicates( Polygon2D_F64 polygon , double tol ) {

		for (int i = polygon.vertexes.size()-1,j=0; i >= 0 && polygon.size()>1; j=i,i--) {
			if( polygon.get(i).isIdentical(polygon.get(j),tol)) {
				return true;
			}
		}
		return false;
	}
public static boolean hasAdjacentDuplicates ( Polygon2D_F64 polygon , double tol ) { for ( int i = polygon . vertexes . size ( ) - 1 , j = 0 ; i >= 0 && polygon . size ( ) > 1 ; j = i , i -- ) { if ( polygon . get ( i ) . isIdentical ( polygon . get ( j ) , tol ) ) { return true ; } } return false ; }
Remove a point if it's identical to a neighbor

@param polygon The polygon being modified
@param tol Tolerance in radians
Remove a point if it s identical to a neighbor