Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
thdrdt
· 6y ago · 0 comments
Sometimes you can even get away by dropping the square completely:
if (x2-x1) - (y2-y1) < (x4-x3) - (y4-y3) then ...
I once used this in a path tracer to speed things up a little. The results where less accurate but sometimes this can be used as trade-off.
Comments
[–]
izackp
6y ago
https://gist.github.com/izackp/5ae96a740678946d8763c198b0e54...
I have a list of functions for distance calculation with metrics on speed and accuracy. If anyone would find it useful.
[–]
TeMPOraL
6y ago
I vaguely recall seeing in Graphics Gems an additional coefficient placed there that's been computed to minimize the error of this metric vs. Euclidean one.