Group points by distance in c#

Whilst I was searching another thing I found by coincindence a solution in this Thread: