Iterate over all points other than the current point
for ( int j = 0 ; j < points . Count ; ++ j ) { if ( j == i ) continue ; int dy = ( ( pair ) points [ i ] ) . second - ( ( pair ) points [ j ] ) . second ; int dx = ( ( pair ) points [ i ] ) . first - ( ( pair ) points [ j ] ) . first ;