For example I have:
array[3] arr1 = {.5,.5,0}
array[3] arr2 = {.5,0,.5}
array[3] arr3 = {0,.5,.5}
array[3] findarr = {1,1,0}
Obviously, arr1 is the best match for findarr. I already have a simple algorithm working but I want to know if there is a formula for how to do this?
Thanks!
f = pow(arrX[0]-findarr[0],2) + pow(arrX[1]-findarr[1],2) + pow(arrX[2]-findarr[2],2);pow(x,2) == x*xSo, “the best match” will be array, with smallest
f