Re: Diagonal Distance/Range
I think the "if (dx>0...)" bits subtract 1 from the range for each of those pairs that are true, so for a diagonal line you'd get range-length 1, 3, 5, 6, 8, 10, 11, 13, 15, 16. For straighter lines you'd be using the shorter coordinate to pass through each of those if gates, so if you have a differential of x=20 y=5 you would add them to get 25 and then subtract one for the first and second if statements, for a total of 23. Hopefully that's clear, and correct.
|