Hello, I would like to know how I can find in a list of vectors a vector that comes close to another pre-selected vector, being the same or not. I appreciate any help.
I found te answer:
def closest(self, vec, list): current = list for val in list: if vec - val < vec - current: current = val return current
This function returns the aproximate vector on the list.