Quote Originally Posted by SkripT
Another time thanks a lot Cesar, your suggestions are very helpfully It's a great idea to calculate a similar color in the table using the distance between two points, I didn't remember that function . I will try it and I comment the results.
You are always welcome
Quote Originally Posted by SkripT
The results of calculating the distance multiplying each term with itself are the same that calculating it as I did with the absolute value, no?
No I didn't. Consider the example:
The point to approximate: P(100, 100, 100).
Two points to choose betwean: A1(75, 125, 100) and A2(100, 51, 100)
Qt Code:
  1. diffSkript(P, A1) = |100 - 75| + |100 - 125| + |100 - 100| = 25 + 25 = 50
  2. diffSkript(P, A2) = |100 - 100| + |100 - 51| + |100 - 100| = 49
  3. diffCesar(P, A1) = (100 - 75)*(100 - 75) + (100 - 125)*(100 - 125) + (100 - 100)*(100 - 100) = 625 + 625 = 1250
  4. diffCesar(P, A2) = (100 - 100)*(100 - 100) + (100 - 51)*(100 - 51) + (100 - 100)*(100 - 100) = 49*49 = 2401
To copy to clipboard, switch view to plain text mode 
As you can see, the results differ. Which one is the best? You choose