Compute squared euclidean distance for the current point
int key = dy * dy ; key += dx * dx ; if ( map . ContainsKey ( key ) ) { map [ key ] ++ ; } else { map [ key ] = 1 ; } } foreach ( int p in map . Values )