3 ms·
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 sp
by thdrdt 6y ago
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.
- TeMPOraL 6y agoI 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.
- izackp 6y agohttps://gist.github.com/izackp/5ae96a740678946d8763c198b0e54d16 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.