I’m trying to compare the distance between Point 1 and Point 2 with the distance between Point 1 and Point 3. And I’m trying to find the smaller one. The only problem is that the xy values of all three points are rather large and using the distance formula will likely cause an overflow. Is there another way to find the distances?
Share
Scale the values by a constant, calculate the distance, then “unscale” the values. For example, divide your values by 10^6, or 10^9, or whatever it takes, then calculate the scaled distance and then convert back using your scale constant.