Finds the closest coordinate in the give coordinate list active.
Returns and array of the size of 3. If secondpass is not enabled these will all be the same ( the closest coordinate).
second_pass enables the search of three closest values, instead of just one.