Difference between revisions of "Distance Formula"
Line 32: | Line 32: | ||
<math display=block>d(p,q) = \sqrt{(p_1- q_1)^2 + (p_2 - q_2)^2+\cdots+(p_i - q_i)^2+\cdots+(p_n - q_n)^2}.</math> | <math display=block>d(p,q) = \sqrt{(p_1- q_1)^2 + (p_2 - q_2)^2+\cdots+(p_i - q_i)^2+\cdots+(p_n - q_n)^2}.</math> | ||
− | == | + | == Licensing == |
− | * [https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance | + | Content obtained and/or adapted from: |
+ | * [https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance, Wikipedia] under a CC BY-SA license |
Latest revision as of 12:38, 14 November 2021
The Euclidean distance between two points in Euclidean space is the length of a line segment between the two points. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefore occasionally being called the Pythagorean distance. These names come from the ancient Greek mathematicians Euclid and Pythagoras, although Euclid did not represent distances as numbers, and the connection from the Pythagorean theorem to distance calculation was not made until the 18th century.
The distance between two objects that are not points is usually defined to be the smallest distance among pairs of points from the two objects. Formulas are known for computing distances between different types of objects, such as the distance from a point to a line. In advanced mathematics, the concept of distance has been generalized to abstract metric spaces, and other distances than Euclidean have been studied. In some applications in statistics and optimization, the square of the Euclidean distance is used instead of the distance itself.
Distance formulas
One dimension
The distance between any two points on the real line is the absolute value of the numerical difference of their coordinates. Thus if and are two points on the real line, then the distance between them is given by:
Two dimensions
In the Euclidean plane, let point have Cartesian coordinates and let point have coordinates . Then the distance between and is given by:
It is also possible to compute the distance for points given by polar coordinates. If the polar coordinates of are and the polar coordinates of are , then their distance is given by the law of cosines:
When and are expressed as complex numbers in the complex plane, the same formula for one-dimensional points expressed as real numbers can be used:
Higher dimensions
In three dimensions, for points given by their Cartesian coordinates, the distance is
Licensing
Content obtained and/or adapted from:
- Euclidean distance, Wikipedia under a CC BY-SA license