This commit is contained in:
Miloslav Ciz 2023-03-04 16:45:41 +01:00
parent 82af4ac894
commit df830630e3
4 changed files with 19 additions and 11 deletions

View file

@ -13,7 +13,7 @@ There are many ways to define distance within given space. Most common and impli
## Approximations
Computing Euclidean distance requires multiplication and most importantly [square root](sqrt.md) which is usually a pretty slow operation, therefore many times we look for simpler [approximations](approximation.md).
Computing Euclidean distance requires multiplication and most importantly [square root](sqrt.md) which is usually a pretty slow operation, therefore many times we look for simpler [approximations](approximation.md). Note that a possible approach here may also lead through computing the distance normally but using a fast approximation of the square root.
Two very basic and rough approximations of Euclidean distance, both in 2D and 3D, are [taxicab](taxicab.md) (also Manhattan) and [Chebyshev](chebyshev.md) distances. Taxicab distance
simply adds the absolute coordinate differences along each principal axis (*dx*, *dy* and *dz*) while Chebyshev takes the maximum of them. In [C](c.md) (for generalization to 3D just add one coordinate of course):