79673438

Date: 2025-06-20 13:21:48
Score: 1
Natty:
Report link

I have been working on a piecewise linear approximation to Euclidian distance as a hobby project and I came up with this formula:

approximation of c = max(a, b) + (sqrt(2)-1)*min(a, b)

for coordinates [x1,y1] and [x2,y2], a = abs(x1-x2) and b = abs(y1-y2)

The upside of the approximation is that it is exact if: a = b, a = 0 or b = 0.

The downside is that the potential error gets bigger the further the points are from each other.

I hope this can inspire you

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Jonas