Wolfram Computation Meets Knowledge

RealEuclideanDistance

Contributed by: Ed Pegg Jr

gives the Euclidean distance between two real vectors without using absolute value.

ResourceFunction["RealEuclideanDistance"][u,v]

gives the Euclidean distance between real vectors u and v without using Abs[].

Examples

Basic Examples

Compute the real Euclidean distance between two points:

In[1]:=
ResourceFunction["RealEuclideanDistance"][{0, 0}, {x, y}]
Out[2]=

Compute in three dimensions:

In[3]:=
ResourceFunction["RealEuclideanDistance"][{0, 0, 0}, {x, y, z}]
Out[3]=

Using numeric values:

In[4]:=
ResourceFunction["RealEuclideanDistance"][{1, 4, -3}, {2, -2, 6}]
Out[4]=

Properties and Relations

EuclideanDistance adds Abs for variables and complicated expressions, making them more complicated. Often, that extra complication will make Simplify more difficult:

In[5]:=
EuclideanDistance[{0, 0}, {x, y}]
Out[5]=

Resource History

Source Metadata