Compute squared euclidean distance for the current point
let key = dy * dy ; key += dx * dx ; if ( map . has ( key ) ) { map . set ( key , map . get ( key ) + 1 ) ; } else { map . set ( key , 1 ) ; } } for ( let [ key , value ] of map . entries ( ) )