# Talk:Euclidean distance

Is that formula for approximating the distance using only integers wrong? Surely if dx and dy are the same (eg, at a 45-degree angle) then dx + dy - 2×min(dx,dy) will always be 0, and the approximation will always be 100% error?

Yea, it was wrong and has been changed. StuRat 16:40, 21 September 2005 (UTC)
I think it is worth noting that the Euclidean metric used to be called Pythagorean metric. At least there should be a page title Pythagorean metric that redirects here. 127

Sure, go ahead and add it. StuRat 20:07, 21 October 2005 (UTC)
Where it says "The technique has been rediscovered numerous times throughout history, as it is a logical extension of the Pythagorean theorem.", are they talking about repeated use of the pythagorean theorem to prove the pythagorean theorem?
The statement seems disjointed.
80.2.17.86 (talk) 23:15, 14 March 2008 (UTC)

A fast approximation of 2D distance based on an octagonal boundary can be computed as follows.
Let 
  
    
      
        d
        x
        =
        
          |
        
        
          p
          
            x
          
        
        −
        
          q
          
            x
          
        
        
          |
        
      
    
    {\displaystyle dx=|p_{x}-q_{x}|}
  
 (absolute value) and 
  
    
      
        d
        y
        =
        
          |
        
        
          p
          
            y
          
        
        −
        
          q
          
            y
          
        
        
          |
        
      
    
    {\displaystyle dy=|p_{y}-q_{y}|}
  
. If 
  
    
      
        d
        y
        >
        d
        x
      
    
    {\displaystyle dy>dx}
  
, approximated distance is 
  
    
      
        0.41
        d
        x
        +
        0.941246
        d
        y
      
    
    {\displaystyle 0.41dx+0.941246dy}
  
.

where do 0.41 and 0.941246 come from? --Abdull 12:59, 21 February 2006 (UTC)
Well. 0.41 sounds like an approximation of sqrt(2).  I don't know where the other coefficient comes from or why it's necessary to have 6 decimal place accuracy (while 0.41 only has a two decimal place accuracy).  StuRat 19:57, 21 February 2006 (UTC)
Those coefficients come from a certain optimal interpolation, which I have calculated some years ago. It goes like this: dy >= dx, therefore dy = a*dx (where a is greater or equal to 1). Distance d is then equal to dx * sqrt(1 + a^2). Now, when you plot the square-root expression for a>=1, it strongly resembles a plain straight line. And those mysterious coefficients are just the description of the optimal interpolation line (b = 0.41 + 0.94*a). Then, d =~ dx * (0.41 + 0.94*a). The last step is a realization that a is in fact dy/dx and performing an appropriate simplification. (One point is missing here, the criteria of interpolation optimality. Frankly, I have forgotten, what condition I have actually used: whether least area between the curve and line, or maximum distance minimization. I have to find the paper and recall it :-)). --BB 09:54, 22 February 2006 (UTC)
One more addition, IIRC, the optimality criterium comes from error-factor formula sqrt(1+a^2)/(0.41+0.941246*a). --BB
Some years ago I developed a similar distance approximation algorithm using three terms, instead of just 2, which is much more accurate, and because it uses power of 2 denominators for the coefficients can be implemented without using division hardware. The formula is: 1007/1024 max(|x|,|y|) + 441/1024 min(|x|,|y|) - if ( max(|x|.|y|)<16min(|x|,|y|), 40/1024 max(|x|,|y|), 0 ). Also it is possible to implement a distance approximation without using either multiplication or division when you have very limited hardware: ((( max << 8 ) + ( max << 3 ) - ( max << 4 ) - ( max << 1 ) + ( min << 7 ) - ( min << 5 ) + ( min << 3 ) - ( min << 1 )) >> 8 ). This is just like the 2 coefficient min max algorithm presented earlier, but with the coefficients 123/128 and 51/128. I have an article about it at http://web.oroboro.com:90/rafael/docserv.php/index/programming/article/distance --Rafael
Perhaps we need a whole new article on distance approximations.  Can you give me an example of a place where min and max functions are available but multiplication and division are not ? StuRat 16:10, 18 May 2006 (UTC)
Obviously this is ancient but I was just browsing this, and the answer is: anywhere that has got add, subtract and compare but not division and multiplication; or even just add and subtract, as long as the sign of the result of the subtract can be used to affect the calculation (e.g. via a conditional branch) (i.e. subtract with sign of result available allows you to roll your own compare). Then you'd more or less trivially be able to roll your own min and max using these. Also worth noting: on old hardware especially, add and subtract can be much faster than multiply and divide, even when these are available. Bmju (talk) 14:44, 15 July 2025 (UTC)
Incidentally we already have an article on this: Alpha max plus beta min algorithm. Also see Pythagorean addition#Fast approximation. —David Eppstein (talk) 18:03, 15 July 2025 (UTC)
You inspired me to start a wikibooks page, please share and improve: http://en.wikibooks.org/wiki/Algorithms/Distance_approximations --mcld (talk) 09:20, 23 September 2012 (UTC)

If you want to know whether objects A and B are at distance c or less, you can compare ((Ax - Bx)^2 + (Ay - By)^2 + (Az - Bz)^2) with c^2, and similarly for other numbers of dimensions.  This avoids the square root entirely.  If c is a constant, then c^2 can be precomputed as well. -- Myria 06:18, 21 July 2006 (UTC)

True, but this is already implied by the section that talks about how distances can be compared while skipping the square root operation. StuRat 05:37, 29 July 2006 (UTC)
Where is that section? I think it was accidentally removed with the approximations, put it back. Comparing distances without using the square root is a simple but very important fact in software/hardware development since the square root is a very expensive operation. Raising the awareness of such a simple fact has a positive contribution to technology and thus humanity which nowadays suffers from slow, overbloated and resource-hungry software. Wikipedia is not only about abstract mathematical concepts.--PE (talk) 11:27, 14 May 2008 (UTC)

I corrected the formula for the distance in circular coordinates. --EarthJoker 12:25, 23 July 2007 (UTC)

Why is the approximation section here? Euclidean metrics are very simple concepts, and I don't think you'd find anything about approximation in 99% of the textbooks that cover the topic. It seems like the audience for that material is different from the audience for the rest of the article. At the very least, there should be a reference here, or some explanation as to why it works.
Also, I moved the approximation sections to the end of the page because it seems important to at least see the 3D version before this is discussed. Triathematician (talk) 01:16, 20 December 2007 (UTC)

As you can see in the first section of this talk page, the approximation section looks like unsourced original research, so I guess that it can be safely removed altogether. Afaic, go ahead. DVdm (talk) 13:55, 20 December 2007 (UTC)

Does this have anything to do with Euclid? If so, should it be mentioned or at least 'See also'ed? Bitwiseb (talk) 17:46, 4 April 2008 (UTC)
Yes, it's the same Euclid. 129.132.152.15 (talk) 10:03, 13 November 2008 (UTC)

What's so unique about the Euclidean metric? What properties does the euclidian metric have that other metric spaces don't have, such as the other Minkowski metrics? What is a rotation in a metric space? Do other metric spaces not have the property that the composition of two rotations is always a rotation? Blackbombchu (talk) 02:03, 29 August 2015 (UTC)

I removed the following section as it imho does really fits here for several reasons. First of all the triangle inequality has its own article, so the definition and various derivations should be handled there. Secondly imho scope and style of the section went a bit against the notion "wikipedia is not a textbook". While proofs or short derivation may on occasion be included or sketched in wikipedia articles, it is usually not desired to have longer technically detailed prrof or textbook derivations/proofs.
Maybe the section can be moved to a suitable project on Wikibooks or to the ProofWiki project.--Kmhkmh (talk) 23:53, 19 March 2019 (UTC)


### Triangle inequality
For any points 
  
    
      
        p
      
    
    {\displaystyle p}
  
, 
  
    
      
        q
      
    
    {\displaystyle q}
  
 and 
  
    
      
        r
      
    
    {\displaystyle r}
  
 holds

  
    
      
        d
        (
        p
        ,
        r
        )
        ⩽
        d
        (
        p
        ,
        q
        )
        +
        d
        (
        q
        ,
        r
        )
        ,
      
    
    {\displaystyle d(p,r)\leqslant d(p,q)+d(q,r),}
  

with equality if and only if there is 
  
    
      
        λ
        ∈
        [
        0
        ,
        1
        ]
      
    
    {\displaystyle \lambda \in [0,1]}
  
 such that 
  
    
      
        q
        −
        p
        =
        λ
        (
        r
        −
        p
        )
      
    
    {\displaystyle q-p=\lambda (r-p)}
  
.
To prove it, we need the following Lemma.


#### Lemma
For any reals 
  
    
      
        
          a
          
            1
          
        
        ,
        
          b
          
            1
          
        
        ,
        …
        ,
        
          a
          
            n
          
        
        ,
        
          b
          
            n
          
        
      
    
    {\displaystyle a_{1},b_{1},\dots ,a_{n},b_{n}}
  
 holds
(*) 
  
    
      
        
          
            (
            
              a
              
                1
              
            
            +
            
              b
              
                1
              
            
            
              )
              
                2
              
            
            +
            ⋯
            +
            (
            
              a
              
                n
              
            
            +
            
              b
              
                n
              
            
            
              )
              
                2
              
            
          
        
        ≤
        
          
            
              a
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              a
              
                n
              
              
                2
              
            
          
        
        +
        
          
            
              b
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              b
              
                n
              
              
                2
              
            
          
        
      
    
    {\displaystyle {\sqrt {(a_{1}+b_{1})^{2}+\cdots +(a_{n}+b_{n})^{2}}}\leq {\sqrt {a_{1}^{2}+\cdots +a_{n}^{2}}}+{\sqrt {b_{1}^{2}+\cdots +b_{n}^{2}}}}
  

with equality iff 
  
    
      
        
          b
          
            i
          
        
        =
        0
      
    
    {\displaystyle b_{i}=0}
  
 for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
 or there is a non-negative 
  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
 such that 
  
    
      
        
          a
          
            i
          
        
        =
        λ
        
          b
          
            i
          
        
      
    
    {\displaystyle a_{i}=\lambda b_{i}}
  

for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
. It is easy to see that if 
  
    
      
        
          b
          
            i
          
        
        =
        0
      
    
    {\displaystyle b_{i}=0}
  
 holds for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
, then equality holds in (*).
Prove we the statement in the case that 
  
    
      
        
          b
          
            i
          
        
        ≠
        0
      
    
    {\displaystyle b_{i}\neq 0}
  
 for at least one 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
. Then 
  
    
      
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        >
        0
      
    
    {\displaystyle b_{1}^{2}+\cdots +b_{n}^{2}>0}
  
.
Both sides of the inequality (*) are non-negative. For this reason, it is equivalent to it's square.

  
    
      
        (
        
          a
          
            1
          
        
        +
        
          b
          
            1
          
        
        
          )
          
            2
          
        
        +
        ⋯
        +
        (
        
          a
          
            n
          
        
        +
        
          b
          
            n
          
        
        
          )
          
            2
          
        
        ≤
        
          a
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          a
          
            n
          
          
            2
          
        
        +
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        +
        2
        
          
            (
            
              a
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              a
              
                n
              
              
                2
              
            
            )
            (
            
              b
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              b
              
                n
              
              
                2
              
            
            )
          
        
        ,
      
    
    {\displaystyle (a_{1}+b_{1})^{2}+\cdots +(a_{n}+b_{n})^{2}\leq a_{1}^{2}+\cdots +a_{n}^{2}+b_{1}^{2}+\cdots +b_{n}^{2}+2{\sqrt {(a_{1}^{2}+\cdots +a_{n}^{2})(b_{1}^{2}+\cdots +b_{n}^{2})}},}
  

which is equivalent to

  
    
      
        
          a
          
            1
          
          
            2
          
        
        +
        2
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          a
          
            n
          
          
            2
          
        
        +
        2
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        +
        
          b
          
            n
          
          
            2
          
        
        ≤
        
          a
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          a
          
            n
          
          
            2
          
        
        +
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        +
        2
        
          
            (
            
              a
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              a
              
                n
              
              
                2
              
            
            )
            (
            
              b
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              b
              
                n
              
              
                2
              
            
            )
          
        
        .
      
    
    {\displaystyle a_{1}^{2}+2a_{1}b_{1}+b_{1}^{2}+\cdots +a_{n}^{2}+2a_{n}b_{n}+b_{n}^{2}\leq a_{1}^{2}+\cdots +a_{n}^{2}+b_{1}^{2}+\cdots +b_{n}^{2}+2{\sqrt {(a_{1}^{2}+\cdots +a_{n}^{2})(b_{1}^{2}+\cdots +b_{n}^{2})}}.}
  

After cancelation, we obtain the equivalent inequality
(**) 
  
    
      
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        ⋯
        +
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        ≤
        
          
            (
            
              a
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              a
              
                n
              
              
                2
              
            
            )
            (
            
              b
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              b
              
                n
              
              
                2
              
            
            )
          
        
        .
      
    
    {\displaystyle a_{1}b_{1}+\cdots +a_{n}b_{n}\leq {\sqrt {(a_{1}^{2}+\cdots +a_{n}^{2})(b_{1}^{2}+\cdots +b_{n}^{2})}}.}
  

To prove this inequality, consider we the inequality

  
    
      
        (
        
          a
          
            1
          
        
        −
        λ
        
          b
          
            1
          
        
        
          )
          
            2
          
        
        +
        ⋯
        +
        (
        
          a
          
            n
          
        
        −
        λ
        
          b
          
            n
          
        
        
          )
          
            2
          
        
        ≥
        0
        ,
      
    
    {\displaystyle (a_{1}-\lambda b_{1})^{2}+\cdots +(a_{n}-\lambda b_{n})^{2}\geq 0,}
  

which holds for all reals 
  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
. It can be rewritten as

  
    
      
        (
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        )
        
          λ
          
            2
          
        
        −
        2
        λ
        (
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        ⋯
        +
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        )
        +
        (
        
          a
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          a
          
            n
          
          
            2
          
        
        )
        ≥
        0
      
    
    {\displaystyle (b_{1}^{2}+\cdots +b_{n}^{2})\lambda ^{2}-2\lambda (a_{1}b_{1}+\cdots +a_{n}b_{n})+(a_{1}^{2}+\cdots +a_{n}^{2})\geq 0}
  
.
This is quadric inequality by 
  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
 because 
  
    
      
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        >
        0
      
    
    {\displaystyle b_{1}^{2}+\cdots +b_{n}^{2}>0}
  
. Because this quadric inequality
holds for all real 
  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
, the discriminant is less or equal to zero.
(***):
  
    
      
        (
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        ⋯
        +
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        )
        ≤
        (
        
          a
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          a
          
            n
          
          
            2
          
        
        )
        (
        
          b
          
            1
          
          
            2
          
        
        +
        ⋯
        +
        
          b
          
            n
          
          
            2
          
        
        )
        .
      
    
    {\displaystyle (a_{1}b_{1}+\cdots +a_{n}b_{n})\leq (a_{1}^{2}+\cdots +a_{n}^{2})(b_{1}^{2}+\cdots +b_{n}^{2}).}
  

Now, we can conclude that

  
    
      
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        ⋯
        +
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        ≤
        
          |
        
        
          a
          
            1
          
        
        
          b
          
            1
          
        
        +
        ⋯
        +
        
          a
          
            n
          
        
        
          b
          
            n
          
        
        
          |
        
        =
        
          
            (
            
              a
              
                1
              
            
            
              b
              
                1
              
            
            +
            ⋯
            +
            
              a
              
                n
              
            
            
              b
              
                n
              
            
            
              )
              
                2
              
            
          
        
        ≤
        
          
            (
            
              a
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              a
              
                n
              
              
                2
              
            
            )
            (
            
              b
              
                1
              
              
                2
              
            
            +
            ⋯
            +
            
              b
              
                n
              
              
                2
              
            
            )
          
        
      
    
    {\displaystyle a_{1}b_{1}+\cdots +a_{n}b_{n}\leq |a_{1}b_{1}+\cdots +a_{n}b_{n}|={\sqrt {(a_{1}b_{1}+\cdots +a_{n}b_{n})^{2}}}\leq {\sqrt {(a_{1}^{2}+\cdots +a_{n}^{2})(b_{1}^{2}+\cdots +b_{n}^{2})}}}
  

and therefore inequality (**) holds.
If equality holds in (**), then the left side of (**) is non-negative and equality in (***) holds. Therefore, there is some real

  
    
      
        λ
      
    
    {\displaystyle \lambda }
  
 such that 
  
    
      
        
          a
          
            i
          
        
        =
        λ
        
          b
          
            i
          
        
      
    
    {\displaystyle a_{i}=\lambda b_{i}}
  
 for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
. The value 
  
    
      
        λ
      
    
    {\displaystyle \lambda }
  

can not be negative because the left side of (***) is non-negative.


### Proof of triangle inequality
Let 
  
    
      
        p
        =
        (
        
          p
          
            1
          
        
        ,
        …
        ,
        
          p
          
            n
          
        
        )
      
    
    {\displaystyle p=(p_{1},\dots ,p_{n})}
  
, 
  
    
      
        q
        =
        (
        
          q
          
            1
          
        
        ,
        …
        ,
        
          q
          
            n
          
        
        )
      
    
    {\displaystyle q=(q_{1},\dots ,q_{n})}
  
 and 
  
    
      
        r
        =
        (
        
          r
          
            1
          
        
        ,
        …
        ,
        
          r
          
            n
          
        
        )
      
    
    {\displaystyle r=(r_{1},\dots ,r_{n})}
  
. Use we notation

  
    
      
        
          a
          
            i
          
        
        =
        
          p
          
            i
          
        
        −
        
          q
          
            i
          
        
      
    
    {\displaystyle a_{i}=p_{i}-q_{i}}
  
, 
  
    
      
        
          b
          
            i
          
        
        =
        
          q
          
            i
          
        
        −
        
          r
          
            i
          
        
      
    
    {\displaystyle b_{i}=q_{i}-r_{i}}
  
.
Applying previous lemma, we have

  
    
      
        
          
            (
            
              p
              
                1
              
            
            −
            
              r
              
                1
              
            
            
              )
              
                2
              
            
            +
            ⋯
            +
            (
            
              p
              
                n
              
            
            −
            
              r
              
                n
              
            
            
              )
              
                2
              
            
          
        
        ≤
        
          
            (
            
              p
              
                1
              
            
            −
            
              q
              
                1
              
            
            
              )
              
                2
              
            
            +
            ⋯
            +
            (
            
              p
              
                n
              
            
            −
            
              q
              
                n
              
            
            
              )
              
                2
              
            
          
        
        +
        
          
            (
            
              q
              
                1
              
            
            −
            
              r
              
                1
              
            
            
              )
              
                2
              
            
            +
            ⋯
            +
            (
            
              q
              
                n
              
            
            −
            
              r
              
                n
              
            
            
              )
              
                2
              
            
          
        
      
    
    {\displaystyle {\sqrt {(p_{1}-r_{1})^{2}+\cdots +(p_{n}-r_{n})^{2}}}\leq {\sqrt {(p_{1}-q_{1})^{2}+\cdots +(p_{n}-q_{n})^{2}}}+{\sqrt {(q_{1}-r_{1})^{2}+\cdots +(q_{n}-r_{n})^{2}}}}
  
,
or

  
    
      
        d
        (
        p
        ,
        r
        )
        ≤
        d
        (
        p
        ,
        q
        )
        +
        d
        (
        q
        ,
        r
        )
      
    
    {\displaystyle d(p,r)\leq d(p,q)+d(q,r)}
  

where equality holds iff 
  
    
      
        q
        =
        r
      
    
    {\displaystyle q=r}
  
 or there is 
  
    
      
        t
        ≥
        0
      
    
    {\displaystyle t\geq 0}
  
 such that

  
    
      
        
          p
          
            i
          
        
        −
        
          q
          
            i
          
        
        =
        t
        (
        
          q
          
            i
          
        
        −
        
          r
          
            i
          
        
        )
      
    
    {\displaystyle p_{i}-q_{i}=t(q_{i}-r_{i})}
  
 holds for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
,
which is equivalent to

  
    
      
        
          q
          
            i
          
        
        −
        
          p
          
            i
          
        
        =
        
          
            t
            
              1
              +
              t
            
          
        
        (
        
          r
          
            i
          
        
        −
        
          p
          
            i
          
        
        )
      
    
    {\displaystyle q_{i}-p_{i}={\frac {t}{1+t}}(r_{i}-p_{i})}
  
 for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  

or

  
    
      
        
          q
          
            i
          
        
        −
        
          p
          
            i
          
        
        =
        λ
        (
        
          r
          
            i
          
        
        −
        
          p
          
            i
          
        
        )
      
    
    {\displaystyle q_{i}-p_{i}=\lambda (r_{i}-p_{i})}
  
 for some 
  
    
      
        λ
        ∈
        [
        0
        ,
        1
        )
      
    
    {\displaystyle \lambda \in [0,1)}
  
 and for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
.
Because 
  
    
      
        q
        =
        r
      
    
    {\displaystyle q=r}
  
 is equivalent to

  
    
      
        
          q
          
            i
          
        
        −
        
          p
          
            i
          
        
        =
        λ
        (
        
          r
          
            i
          
        
        −
        
          p
          
            i
          
        
        )
      
    
    {\displaystyle q_{i}-p_{i}=\lambda (r_{i}-p_{i})}
  
 for 
  
    
      
        λ
        =
        1
      
    
    {\displaystyle \lambda =1}
  
 and for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
.
We can conclude that equality holds in the triangle inequality iff

  
    
      
        
          q
          
            i
          
        
        −
        
          p
          
            i
          
        
        =
        λ
        (
        
          r
          
            i
          
        
        −
        
          p
          
            i
          
        
        )
      
    
    {\displaystyle q_{i}-p_{i}=\lambda (r_{i}-p_{i})}
  
 for some 
  
    
      
        λ
        ∈
        [
        0
        ,
        1
        ]
      
    
    {\displaystyle \lambda \in [0,1]}
  
 and for all 
  
    
      
        i
        ∈
        {
        1
        ,
        …
        ,
        n
        }
      
    
    {\displaystyle i\in \{1,\dots ,n\}}
  
.

If we present the Euclidean distance as a l2 norm, the squared norm is

  
    
      
        f
        (
        x
        )
        =
        ‖
        x
        
          ‖
          
            2
          
          
            2
          
        
        =
        
          
            (
            
              
                (
                
                  
                    ∑
                    
                      k
                      =
                      1
                    
                    
                      n
                    
                  
                  
                    x
                    
                      k
                    
                    
                      2
                    
                  
                
                )
              
              
                1
                
                  /
                
                2
              
            
            )
          
          
            2
          
        
        =
        
          ∑
          
            k
            =
            1
          
          
            n
          
        
        
          x
          
            k
          
          
            2
          
        
      
    
    {\displaystyle f(x)=\|x\|_{2}^{2}=\left(\left(\sum _{k=1}^{n}x_{k}^{2}\right)^{1/2}\right)^{2}=\sum _{k=1}^{n}x_{k}^{2}}
  

Then the gradient is 

  
    
      
        
          
            ∂
            
              ∂
              
                x
                
                  j
                
              
            
          
        
        f
        (
        x
        )
        =
        
          
            ∂
            
              ∂
              
                x
                
                  j
                
              
            
          
        
        
          ∑
          
            k
            =
            1
          
          
            n
          
        
        
          x
          
            k
          
          
            2
          
        
        =
        
          ∑
          
            k
            =
            1
          
          
            n
          
        
        
          
            ∂
            
              ∂
              
                x
                
                  j
                
              
            
          
        
        
          x
          
            k
          
          
            2
          
        
        =
        2
        
          x
          
            j
          
        
        .
      
    
    {\displaystyle {\frac {\partial }{\partial x_{j}}}f(x)={\frac {\partial }{\partial x_{j}}}\sum _{k=1}^{n}x_{k}^{2}=\sum _{k=1}^{n}{\frac {\partial }{\partial x_{j}}}x_{k}^{2}=2x_{j}.}
  

It follows

  
    
      
        ∇
        f
        (
        x
        )
        =
        2
        x
        .
      
    
    {\displaystyle \nabla f(x)=2x.}
  

— Preceding unsigned comment added by Lantonov (talk • contribs) 22:29, 9 November 2020 (UTC)

Ok, but (1) this is the gradient of the squared Euclidean norm, not of the squared Euclidean distance. The Euclidean norm is only treated briefly in this article before pointing to a different article on that topic. So it is removed in three ways from the actual topic of this article: distance squared not distance, norm not distance, and gradient. Is this level of removal still sufficiently relevant to be included in this article? (2) How does the detailed calculation do anything but intimidate readers? Please remember in particular that students likely learn about Euclidean distance somewhere in middle school or high school, and that therefore to the extent possible we should try to keep material in this article to that level. The squared distance section already does go beyond that but we don't need to make it more so. (3) Where are the published sources for this calculation? We would in any case also need sources in order to say anything about why this is relevant to the topic of this article. —David Eppstein (talk) 22:34, 9 November 2020 (UTC)
This is not a gradient of the Euclidean norm, but of the squared Euclidean norm. One can easily transform this equation to include the distance instead of norm. If I search my textbooks maybe I shall find a reference; however, the calculations are obvious for anyone who can differentiate and know what a gradient is. Anyway, I agree to your argument that this sentence is somehow out-of-place here. Lantonov (talk) 22:47, 9 November 2020 (UTC)
Before your reply, I edited my comment to make clear that I meant the squared norm. You removed that correction from my comment. I assume it was accidental but please do not do that. Anyway, yes, you can get a similar formula for distance, but only in an artificial way by holding one point fixed and letting the other be variable. If both points are variable the gradient is higher-dimenional. —David Eppstein (talk) 23:10, 9 November 2020 (UTC)
It was accidental. I never delete people's comments deliberately. Partially agree for the two variable points: it is a Cartesian product with twice the dimensions, something like this:

  
    
      
        
          
            ∂
            
              ∂
              q
            
          
        
        
          (
          
            
              
                ∂
                (
                p
                (
                q
                )
                −
                q
                (
                p
                )
                
                  )
                  
                    2
                  
                
              
              
                ∂
                p
              
            
          
          )
        
        =
        −
        2
        
          
            
              ∂
              p
            
            
              ∂
              q
            
          
        
        
          
            
              ∂
              q
            
            
              ∂
              p
            
          
        
      
    
    {\displaystyle {\frac {\partial }{\partial q}}\left({\frac {\partial (p(q)-q(p))^{2}}{\partial p}}\right)=-2{\frac {\partial p}{\partial q}}{\frac {\partial q}{\partial p}}}
  

However, we have a little twist here: the Cartesian frame in Euclidean space is orthogonal meaning that terms with mixed partial derivatives are zero, that is:

  
    
      
        
          ∑
          
            k
            =
            1
          
          
            n
          
        
        
          
            ∂
            
              ∂
              
                x
                
                  j
                
              
            
          
        
        
          x
          
            k
          
          
            2
          
        
        =
        
          
            {
            
              
                
                  0
                  ,
                
                
                  
                    if 
                  
                  j
                  ≠
                  k
                
              
              
                
                  2
                  
                    x
                    
                      j
                    
                  
                  ,
                
                
                  
                    else 
                  
                
              
            
            
          
        
      
    
    {\displaystyle \sum _{k=1}^{n}{\frac {\partial }{\partial x_{j}}}x_{k}^{2}={\begin{cases}0,&{\text{if }}j\neq k\\2x_{j},&{\text{else }}\end{cases}}}
  

Lantonov (talk) 06:50, 10 November 2020 (UTC)

I don't like the categorical statement that "the squared Euclidean distance cannot be a metric because it does not satisfy the triangle ineqality" although this statement is properly sourced. Mathematically, the statement is OK if we understand the metric as metric (mathematics); however, in general relativity by metric is understood the metric tensor (general relativity) and then the statement is not true: squared Euclidean distance generates the metric of the flat 3-D (Euclidean) space. This is a source of confusion for readers with different backgrounds. Lantonov (talk) 10:21, 10 November 2020 (UTC)

I changed it to "does not form a metric space, as it does not satisfy the triangle inequality". Is that adequately unambiguous? —David Eppstein (talk) 17:30, 10 November 2020 (UTC)
The problem is different. In relativity, the books say:
Euclidean metric (that is, the metric of the Euclidean space)

  
    
      
        d
        
          s
          
            2
          
        
        =
        d
        
          x
          
            2
          
        
        +
        d
        
          y
          
            2
          
        
        +
        d
        
          z
          
            2
          
        
      
    
    {\displaystyle ds^{2}=dx^{2}+dy^{2}+dz^{2}}
  

Minkowski metric

  
    
      
        d
        
          s
          
            2
          
        
        =
        
          c
          
            2
          
        
        d
        
          t
          
            2
          
        
        −
        d
        
          x
          
            2
          
        
        −
        d
        
          y
          
            2
          
        
        −
        d
        
          z
          
            2
          
        
      
    
    {\displaystyle ds^{2}=c^{2}dt^{2}-dx^{2}-dy^{2}-dz^{2}}
  
 or alternatively

  
    
      
        d
        
          s
          
            2
          
        
        =
        d
        
          x
          
            2
          
        
        +
        d
        
          y
          
            2
          
        
        +
        d
        
          z
          
            2
          
        
        −
        
          c
          
            2
          
        
        d
        
          t
          
            2
          
        
      
    
    {\displaystyle ds^{2}=dx^{2}+dy^{2}+dz^{2}-c^{2}dt^{2}}
  

general metric of a curved space

  
    
      
        d
        
          s
          
            2
          
        
        =
        
          g
          
            i
            k
          
        
        d
        
          x
          
            i
          
        
        d
        
          x
          
            k
          
        
      
    
    {\displaystyle ds^{2}=g_{ik}dx^{i}dx^{k}}
  
, etc.
Everywhere, by metric 
  
    
      
        d
        
          s
          
            2
          
        
      
    
    {\displaystyle ds^{2}}
  
 (written exactly so) it is understood the squared distance in the respective space. That's why the statement that the squared distance is not a metric sounds strange in this field. Lantonov (talk) 18:26, 10 November 2020 (UTC)
Do they really call it a "metric space", though? I think that term unambiguously means a set with a symmetric positive distance satisfying the triangle inequality. —David Eppstein (talk) 18:38, 10 November 2020 (UTC)
Mentioning "metric space" is wading into another bog because there are many kinds of metric spaces. Specifically, in general relativity the space is a connected Riemannian manifold M, which is turned into a metric space by defining the distance between two points as the infimum of the lengths of the paths (continuously differentially curves) connecting them. Also, a positive-definite inner product gp is defined on the tangent space TpM at each point p. The family gp of inner products is called a Riemannian metric (or Riemannian metric tensor). Here you can see how Euclidean space and Euclidean metric are defined through Riemannian space and metric. Lantonov (talk) 20:08, 10 November 2020 (UTC)
But all of those things are called metric spaces because they are metric spaces in the sense that their distance is symmetric, positive, and obeys the triangle inequality. They have additional properties, of course, as does the Euclidean distance. —David Eppstein (talk) 20:39, 10 November 2020 (UTC)
If you take the metric tensor as the space metric, it is symmetric in all cases. Whether positive (or its determinant is positive) is a matter of convention. In most books the determinant of the metric tensor is negative. About the triangle inequality, I lack imagination how it can be applied to tensors. In any case, in a curved space, it makes difference in which direction you are going. Often, it is shorter to go from p to r through q than directly, whatever "directly" is. The shortest distance between two points in a curved space is along a geodesic curve, which is not a straight line. We can see this already on the Earth surface. The  orthodromic distance is the shortest distance between two points on the Earth surface but it is not a straight line. Lantonov (talk) 22:00, 10 November 2020 (UTC)
I still don't see what your point is. Orthodromic and geodesic distances are still distance functions that define metric spaces. "Metric tensor" and "metric space" use different words so it should not be surprising that they determine different concepts. —David Eppstein (talk) 22:06, 10 November 2020 (UTC)
Your last sentence is exactly the point. Metric (mathematics) and metric tensor (general relativity) are different concepts and both are called "metric" in their respective fields. The first one cannot be a squared distance, while the second one is, in fact, the squared distance. You can see this, for example, in the disambiguation page metric. The statement "squared distance cannot be a metric" is (mildly) misleading because it does not explicitly say that it has in mind the metric in the mathematical sense. It is certainly not true for the Euclidean space and metric as defined in relativity. The reference after this statement gives as an example the number line on which the Euclidean distance satisfies the triangle inequality while the squared Euclidean distance does not. However, when choosing basis vectors for the tangent space on a Riemannian manifold, it is specified at the start that the basis vectors should be linearly independent, which excludes them being on the same straight line. So these are indeed different concepts. Lantonov (talk) 07:12, 11 November 2020 (UTC)
Re both are called "metric" in their respective fields: But we are not talking about the word "metric", we are talking about the phrase "metric space". Is that exact phrase ever used to mean something that cannot be viewed as a special case of the definition at the article metric space? —David Eppstein (talk) 07:57, 11 November 2020 (UTC)
Yes, you are right about this. Talking about "metric space" and avoiding the ambiguos term "metric" makes it true also for Riemannian space. The shortest path between two points there is a geodesic which is not a straight line but is well defined. Lantonov (talk) 09:30, 11 November 2020 (UTC)

The following edits were recently reverted.
1. Removal of reference to squared distance being called "quadrance" in rational trigonometry as WP:UNDUE.  This seemed clear enough; if the article were trying to catalogue appearances and avatars of squared distance, things like quadratic forms, Hilbert space and Bregman divergence would have far higher priority but are not even mentioned.  Rational trigonometry is a one-man show by its inventor, has not caught on whatsoever (as noted in its Wikipedia page), and is already being hyped at a number of other WP locations. No need to promote it where it is at best marginally related to the topic.
2. Reworking of the statements on non-Euclidean geometry.  The problematic passage states:

"Although accurate measurements of long distances on the earth's surface, which are not Euclidean, had again been studied in many cultures since ancient times (see history of geodesy), the idea that Euclidean distance might not be the only way of measuring distances between points in mathematical spaces came even later, with the 19th-century formulation of non-Euclidean geometry".
This is wrong as a description of non-Euclidean geometry.  It is anachronistic; the notion of "mathematical space" came later, and distance functions on such spaces. It is also misleading: it was a familiar everyday fact that travel distance differs from Euclidean distance (hence the phrase "as the crow flies"), and well known to cognoscenti that maps of the Earth distort distance and that spherical geometry/trigonometry differ from the Euclidean version.   
My attempt to state this more correctly is the last paragraph of  https://en.wikipedia.org/w/index.php?title=Euclidean_distance&oldid=996504346#History .  This has been reverted as "tendentious" by @David Eppstein:, but I do not understand what he thinks is wrong with it or how it is inferior to the preceding. 73.89.25.252 (talk) 07:13, 27 December 2020 (UTC)

It is ridiculously WP:TECHNICAL, for an article that at least in part needs to be readable by schoolchildren. It removes relevant and sourced information. And things like quadratic forms and Bregman divergence are not even close to being Euclidean distances. We have separate articles already where they belong much better. Hilbert spaces are already present (in a very non-technical way) in the mention of infinite dimensions in the "generalizations" section, with links for those looking for real information. In contrast, the material on squared Euclidean distance that you removed could plausibly be split off into a second article, but I am not convinced there is enough notability for it to stand alone as a separate article (certainly not under the "quadrance" title of the part you removed, as that is mostly just Wildberger reinventing the wheel) and in the meantime this article is the place for it. As for your removal of geodesy: it would be seriously misleading to say in this article that Euclidean distance was the only distance used even by non-mathematicians prior to the 19th century. And finally, reverting a set of bad edits once does not even come close to edit warring. —David Eppstein (talk) 07:17, 27 December 2020 (UTC)

(Moved from above. 73.89.25.252 (talk) 20:22, 30 December 2020 (UTC)) 
FWIW, I saw that mention of "rational trigonometry" a while back and thought about cutting it per WP:DUE. Does including it here truly enrich anyone's understanding of Euclidean distance, or geometry in general? I'm doubtful. XOR'easter (talk) 05:56, 28 December 2020 (UTC)

I figured that if we're going to have an article on rational trigonometry at all, it would be better to mention it briefly in a context that we make very clear that squared Euclidean distance is far from a new idea, rather than avoiding the subject and allowing readers to keep the impression that "quadrance" is something new and different. But I suppose we could try again to delete the rational trigonometry article — if it were gone, I would support also removing mention of it from here. —David Eppstein (talk) 06:48, 28 December 2020 (UTC)
I don't relish the thought of the inevitable "keep, because it's long and has footnotes" comments that rational trigonometry would get in an AfD, but the last one was in 2013, so maybe it's time again. XOR'easter (talk) 19:25, 28 December 2020 (UTC)
There are entire fields of mathematics that are in large part hype surrounding a prosaic foundation of ordinary theorems about previously unhyped areas.  E.g., chaos theory, catastrophe theory, complex systems, the set theory multiverse... and check out some of the math articles in Quanta these days!  Wildberger is comparatively humble in that he is only claiming a new approach to an old subject, and is putting out conventionally written articles on the Arxiv whose only crime is to introduce new terminology ("chromogeometry", anyone?).  He does not seem to be developing an institutionalized personality cult either, of the sort that has been a problem in some of those fields.  So it's pretty harmless and I don't see it as unreasonable to have an article on R.T as a mathematical subject rather than the book.  But the other way around is also acceptable. 73.89.25.252 (talk) 19:28, 30 December 2020 (UTC)
If quadrance/rat.trig are unimportant to explaining or contextualizing Euclidean distance then regardless of the state of other articles, they should be removed from this one. Quadrance currently redirects to a place where it is, or can be, clearly explained that it is a new name for an old quantity. 73.89.25.252 (talk) 19:28, 30 December 2020 (UTC)
I tried rewriting the rational trig article to be about the book. If that sticks, I don't think we need to continue mentioning it here. —David Eppstein (talk) 18:22, 30 December 2020 (UTC)

An editor has identified a potential problem with the redirect Euclidean metric and has thus listed it for discussion. This discussion will occur at Wikipedia:Redirects for discussion/Log/2022 May 4#Euclidean metric until a consensus is reached, and readers of this page are welcome to contribute to the discussion.  fgnievinski (talk) 17:05, 4 May 2022 (UTC)

Article Metric (mathematics) says:

...a metric or distance function is a function that gives a distance between each pair of point elements of a set.
Article Metric space says:

In fact, a "metric" is the generalization of the Euclidean metric arising from the four long-known properties of the Euclidean distance. The Euclidean metric defines the distance between two points as the length of the straight line segment connecting them.

I still don't get why folks seem upset with applying MOS:BOLDREDIRECT to "Euclidean metric"? Squared Euclidean distance already calls it a "function" -- what else does the WP-Math cabal need? fgnievinski (talk) 22:35, 4 May 2022 (UTC)

Do you really not understand the significant difference between "distance" (a number, between two points), "distance function" (a thing that takes pairs of points and spits out numbers), and "Euclidean metric" (a space of points together with a distance function on it)? Or the significant gap in audience maturity required to go from one of these concepts to the next? Despite having this repeatedly pointed out to you, none of your comments, including this one, exhibit any understanding of these issues. —David Eppstein (talk) 22:44, 4 May 2022 (UTC)
"Euclidean distance" is also routinely interpreted as the "Euclidean distance function" between any two arbitrary points. Sometimes mathematicians have a very very narrow interpretation. The term Euclidean metric is used by physicists, programmers, etc. in a less strict manner. fgnievinski (talk) 22:56, 4 May 2022 (UTC)
In advanced mathematics, the concept of distance has been generalized to abstract metric spaces, and other distances than Euclidean have been studied. is perfectly enough. Anyone who knows what a "metric" is (a small subset of this article's intended audience!) can reasonably infer what the "Euclidean metric" is. In all likelihood, such a person will have already been introduced to the Euclidean metric on R^n as their first example. WP math articles already have a reputation for turning elementary concepts into turgid prose, and imo we should do as much as possible to fight that. Readers first! Ovinus (talk) 00:33, 5 May 2022 (UTC)
It is true that people who have some idea what a multivariate function is can reasonably infer that there is a function mapping pairs of points to their distance, and it is also true that that function is sometimes called, for short, "Euclidean distance". But, Fgnievinski, you are still wilfully continuing to miss the point. I want this article to be readable by people who are not experts in real analysis. I want it to be readable by people who have not yet really learned what a function is. I think it should be possible to understand the distance between points without understanding the nature of functions. I think this possibility is clearly demonstrated by the ancient nature of Euclidean distance and the much less ancient nature of real analysis: the ancient Greek mathematicians do not appear to have had an adequate notion of functions as a general class of mathematical objects, but still were well acquainted with lengths of line segments. —David Eppstein (talk) 00:52, 5 May 2022 (UTC)

I'm not sure where/how best to integrate a few subjects that seem worth mentioning here.
1. Loci of equidistant points. I think it's worth discussing how the locus of points equidistant from a point is a circle, the locus of points equidistant from a circle is a concentric circle, the locus of points equidistant from a straight line is a parallel line, and in general it's possible to draw the locus of points equidistant to some curve (Parallel curve) or other point set. Also cf. Signed distance function.
2. Various measures of the "distance" between various kinds of shapes are based on Euclidean distance, and have useful applications. For example, the Fréchet distance between curves.
3. Chord length vs. arc length vs. other measurements between points on a curve or surface. In e.g. Greek spherics/astronomy, compasses were used to draw circles on solid spheres and transfer geometric objects between the sphere and an auxiliary plane. Hipparchus' foundation of trigonometry in relating circular chord length to arc length had to do with this "chordal" Euclidean distance inherited from the ambient Euclidean space.
4. Squared distance in pseudo-Euclidean space, and the comparison between "space-like" vs. "time-like" vs. "light-like" displacements in spacetime.
@David Eppstein any thoughts? –jacobolus (t) 20:07, 18 November 2023 (UTC)

My general reaction is: This is a specific article on Euclidean distance, not a catch-all for any vaguely related notion, and it is important for it to stay focused on its actual topic. None of the things you describe are really "sub-subjects" of Euclidean distance. Arc length is off-topic here. Length and distance are not really the same thing (as evidenced by the millenia-long gap between the study of lengths of non-straight curves and the formulation of non-Euclidean geometry and non-Euclidean distances) and we have separate articles for them. "Various measures of difference between shapes" goes in the "Objects other than points" section, which already briefly mentions two such measures: minimum distance and Hausdorff distance. It might go too far in the way of excessive detail on off-topic subjects, though (Good Article criterion 3b) to give a proper definition of the Frechet distances for curves (there is more than one incompatible way of defining Frechet distance). —David Eppstein (talk) 20:42, 18 November 2023 (UTC)
Maybe geodesic distance should be pulled into a separate section or subsection. Arc length is geodesic distance along a curve: a direct generalization of Euclidean distance, found by breaking a curve up into infinitesimal parts and then integrating the Euclidean distance over the parts. –jacobolus (t) 20:49, 18 November 2023 (UTC)
Again, this is a focused article on Euclidean distance. We have a more general article on distance and a separate focused article on geodesics. Geodesic distance is not the same as Euclidean distance. It is not constructive to make all articles in a related cluster of topics become duplicates of each other by incorporating their content into each other. The article you linked to, geodesic distance, is even more vaguely related: it redirects to something on graph theory rather than surface geometry. —David Eppstein (talk) 20:50, 18 November 2023 (UTC)
This article is very short, and I feel like it is predominantly focused on lists of formulas instead of explaining how the concept is related to other concepts or how it is used; if I had to give name to the current scope, I'd summarize as something like "formulas for calculating Euclidean distance in Cartesian coordinate systems, with a few asides".
You're right that geodesic distance points the wrong place; I meant to link to geodesic. The link geodesic distance should probably redirect to geodesic or intrinsic metric instead of distance (graph theory). –jacobolus (t) 20:54, 18 November 2023 (UTC)
The most common use I see of the phrase "geodesic distance" involves shortest paths in polygons, about which we do not even have an article.
The place for explaining in detail how different distance concepts relate to each other is distance.
As for "very short": this article falls well into the middle range of lengths of MOS:LEADLENGTH and far above the "combine with other topics" threshold of WP:SIZERULE. The formulas are only one of its five sections. —David Eppstein (talk) 21:11, 18 November 2023 (UTC)
Hm. A google scholar search turns up a lot of sources about geodesics with "geodesic distance" in them. But maybe it should be a disambig page. –jacobolus (t) 21:42, 18 November 2023 (UTC)
To be clear, I think the name "Euclidean distance" should clearly be its own article, not combined with others. I just mean that discussing other concepts built on top, alternatives, or generalizations here doesn't seem like it would make the article excessively long, impinge on readers' ability to make sense of the material currently here, or really be "off topic".
We currently discuss generalizations to manhattan distance and chebyshev distance. These are generalizations based on the concept of "Euclidean distance" explicitly thought of as "distance in Cartesian coordinates for a Euclidean space". That is, these are ideas you get by 'keep the idea of distance for coordinates, but ditch the "Euclidean" part'. But when I think of the term "Euclidean distance", I think the idea should also include geometrical concepts (parallel lines, circles, chord-based distance between points on surfaces embedded in Euclidean space, ...) rather than only arithmetized coordinate concepts. –jacobolus (t) 21:46, 18 November 2023 (UTC)
The way you keep referring to this article as being only about coordinates makes me think you haven't read the history section of this article. The coordinate-based view is relatively recent. —David Eppstein (talk) 21:59, 18 November 2023 (UTC)
I agree that the coordinate-based view is relatively recent (didn't really dominate until the 20th century, is my impression). Which is further reason to try to flesh out a broader geometrical explanation! –jacobolus (t) 22:19, 18 November 2023 (UTC)
Only if that fleshing-out is about Euclidean distance. Padding articles with off-topic details about vaguely related topics is not improvement. Please also keep in mind WP:TECHNICAL: the Pythagorean formula for Euclidean distance is commonly studied by schoolchildren, justifying its prominence and early placement in this article. Other material can be included but should not be placed in a way that would make the more-accessible parts of the article harder to find for the part of the audience that might be looking for them. —David Eppstein (talk) 22:32, 18 November 2023 (UTC)
While we're on the subject of history, it's probably worth mentioning Heron's Metrica, which took a much more numerical approach to geometry than previous Greek work. –jacobolus (t) 01:03, 19 November 2023 (UTC)
Aside from which additional here might be appropriate here, I'd like to emphasize there is no general need to turn every short or midsized article into long one. Many smaller articles serves the readers just fine and much of the suggested material above might be better in separate entries and/or the overview article  for distance. --Kmhkmh (talk) 22:36, 18 November 2023 (UTC)

Absolute difference is of course just a special case of the Euclidean distance. The article is stub-class, high-priority, and contains little to no information not already present here.
I propose to merge/redirect the foregoing article to Euclidean distance#One dimension. Sasha foxxo (talk) 14:12, 24 February 2025 (UTC)

I think it's a separate enough topic to be handled separately. It is generally thought of as an operation on numbers, not on one-dimensional geometric points. (These may formalize as the same things but conceptually they are very different.) Why do you think it is helpful to bury the information about it in a much longer article where people looking for it will have a much more difficult time finding it? Also I would disagree that it is stub-class; it looks more like start-class length to me.
But to me a much stronger reason to oppose the merge is that absolute difference would be misplaced in an article about Euclidean distance. Absolute difference is a special case of the Lp distances in all dimensions, the 
  
    
      
        d
        =
        1
      
    
    {\displaystyle d=1}
  
 case. Euclidean distance is a special case for a different parameter, the 
  
    
      
        p
        =
        2
      
    
    {\displaystyle p=2}
  
 case. So why is that special case the one that it should be merged into, rather than the general case of Lp distances? There is no well-formed hierarchy of distance topics for which that makes sense. —David Eppstein (talk) 18:47, 24 February 2025 (UTC)
The usual Euclidean distance is 
  
    
      
        p
        =
        2
      
    
    {\displaystyle p=2}
  
, but this article actually appears to treat 
  
    
      
        p
        ∈
        
          N
        
      
    
    {\displaystyle p\in \mathbb {N} }
  
, i.e. distance in 
  
    
      
        
          
            R
          
          
            n
          
        
      
    
    {\displaystyle \mathbb {R} ^{n}}
  
. I'm used to referring to p-norms for the case where p is an arbitrary real. One is typically a linear-algebraic concept, the other a functional-analytic one.
Your edits to the article to be merged I think solve the issue. Thanks for tolerating my ignorance of wikipedian norms :) Sasha foxxo (talk) 19:36, 24 February 2025 (UTC)
Well, this is embarrassing; I've inexplicably confused 
  
    
      
        p
      
    
    {\displaystyle p}
  
 and 
  
    
      
        d
      
    
    {\displaystyle d}
  
. I've reverted the merge request. Sasha foxxo (talk) 20:09, 24 February 2025 (UTC)
This should definitely not be "high" priority; I changed it to "mid". I don't think it should be merged, since from what I can tell it is usually not really thought of as a geometric "distance" per se. One application perhaps worth mentioning (shows up prominently in Google scholar searches for the term) is motion estimation in video coding, for which computing sums of absolute differences is apparently the most computationally expensive step.  –jacobolus (t) 19:51, 24 February 2025 (UTC)