euclidean distance
Information about euclidean distance
In mathematics, the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, which can be proven by repeated application of the Pythagorean theorem. By using this formula as distance, Euclidean space becomes a metric space (even a Hilbert space). Older literature refers to this metric as Pythagorean metric. The technique has been rediscovered numerous times throughout history, as it is a logical extension of the pythagorean theorem.
and
, in Euclidean n-space, is defined as:
and
, the distance is computed as:
The absolute value signs are used, since distance is normally considered to be an unsigned scalar value.
and
, the distance is computed as:
Alternatively, expressed in circular coordinates (also known as polar coordinates), using
and
, the distance can be computed as:
(absolute value) and
. If
, approximated distance is
.
(If
, swap these values.)
The difference from the exact distance is between -6% and +3%; more than 85% of all possible differences are between −3% to +3%.
The following Maple code implements this approximation:
Other approximations exist as well. They generally try to avoid the square root, which is an expensive operation in terms of processing time, and provide various error:speed ratio. Using the above notation, dx + dy − (1/2)×min(dx,dy) yields error in interval 0% to 12% (attributed to Alan Paeth). A better approximation in term of RMS error is: dx + dy - (5/8)×min(dx,dy) and yields error in interval −3% to 7%.
Also note that when comparing distances (for which is greatest, not for the actual difference), it isn't necessary to take the square root at all. If distance
is greater than distance
, then
will also be greater than
. Or, when checking to see if distance
is greater than
, that is the same as comparing
with
or
, etc. An example of the first case might be when trying to determine which nearest grid point an arbitrary point should "snap to" in a 2D CAD/CAM system. This isn't really an approximation, however, as the results are exact.
and
, the distance is computed as
is greater than distance
, then
will also be greater than
. An example is when searching for the minimum distance between two surfaces in 3D space, using a 3D CAD/CAM system. One way to start would be to build a point grid on each surface, and compare the distance of every grid point on the first surface with every grid point on the second surface. It isn't necessary to know the actual distances, but only which distance is the least. Once the closest two points are located, a much smaller point grid could be created around those closest points on each surface, and the process repeated. After several iterations, the closest two points could then be fully evaluated, including the square root, to give an excellent approximation of the minimum distance between the two surfaces. Thus, the square root only needs to be taken once, instead of thousands (or even millions) of times.
Definition
The Euclidean distance between points
and
, in Euclidean n-space, is defined as:
One-dimensional distance
For two 1D points,
and
, the distance is computed as:
The absolute value signs are used, since distance is normally considered to be an unsigned scalar value.
Two-dimensional distance
For two 2D points,
and
, the distance is computed as:
Alternatively, expressed in circular coordinates (also known as polar coordinates), using
and
, the distance can be computed as:
2D approximations for computer applications
A fast approximation of 2D distance based on an octagonal boundary can be computed as follows. Let
(absolute value) and
. If
, approximated distance is
.
(If
, swap these values.)
The difference from the exact distance is between -6% and +3%; more than 85% of all possible differences are between −3% to +3%.
>
fasthypot :=
unapply(piecewise(abs(dx)>abs(dy),
abs(dx)*0.941246+abs(dy)*0.41,
abs(dy)*0.941246+abs(dx)*0.41),
dx, dy):
hypot := unapply(sqrt(x^2+y^2), x, y):
plots[display](
plots[implicitplot](fasthypot(x,y) > 1,
x=-1.1..1.1,
y=-1.1..1.1,
numpoints=4000),
plottools[circle]([0,0], 1),
scaling=constrained,thickness=2
);
Other approximations exist as well. They generally try to avoid the square root, which is an expensive operation in terms of processing time, and provide various error:speed ratio. Using the above notation, dx + dy − (1/2)×min(dx,dy) yields error in interval 0% to 12% (attributed to Alan Paeth). A better approximation in term of RMS error is: dx + dy - (5/8)×min(dx,dy) and yields error in interval −3% to 7%.
Also note that when comparing distances (for which is greatest, not for the actual difference), it isn't necessary to take the square root at all. If distance
is greater than distance
, then
will also be greater than
. Or, when checking to see if distance
is greater than
, that is the same as comparing
with
or
, etc. An example of the first case might be when trying to determine which nearest grid point an arbitrary point should "snap to" in a 2D CAD/CAM system. This isn't really an approximation, however, as the results are exact.
Three-dimensional distance
For two 3D points,
and
, the distance is computed as
3D approximations for computer applications
As noted in the 2D approximation section, when comparing distances (for which is greatest, not for the actual difference), it isn't necessary to take the square root at all. If distance
is greater than distance
, then
will also be greater than
. An example is when searching for the minimum distance between two surfaces in 3D space, using a 3D CAD/CAM system. One way to start would be to build a point grid on each surface, and compare the distance of every grid point on the first surface with every grid point on the second surface. It isn't necessary to know the actual distances, but only which distance is the least. Once the closest two points are located, a much smaller point grid could be created around those closest points on each surface, and the process repeated. After several iterations, the closest two points could then be fully evaluated, including the square root, to give an excellent approximation of the minimum distance between the two surfaces. Thus, the square root only needs to be taken once, instead of thousands (or even millions) of times.
See also
Mathematics (colloquially, maths or math) is the body of knowledge centered on such concepts as quantity, structure, space, and change, and also the academic discipline that studies them. Benjamin Peirce called it "the science that draws necessary conclusions".
..... Click the link for more information.
..... Click the link for more information.
Distance is a numerical description of how far apart objects are at any given moment in time. In physics or everyday discussion, distance may refer to a physical length, a period of time, or an estimation based on other criteria (e.g. "two counties over").
..... Click the link for more information.
..... Click the link for more information.
In mathematics, the Pythagorean theorem (AmE) or Pythagoras' theorem (BrE) is a relation in Euclidean geometry among the three sides of a right triangle. The theorem is named after the Greek mathematician Pythagoras, who by tradition is credited with its discovery and
..... Click the link for more information.
..... Click the link for more information.
In mathematics, a metric space is a set where a notion of distance (called a metric) between elements of the set is defined.
The metric space which most closely corresponds to our intuitive understanding of space is the 3-dimensional Euclidean space.
..... Click the link for more information.
The metric space which most closely corresponds to our intuitive understanding of space is the 3-dimensional Euclidean space.
..... Click the link for more information.
Hilbert space, named after the David Hilbert, generalizes the notion of Euclidean space in a way that extends methods of vector algebra from the two-dimensional plane and three-dimensional space to infinite-dimensional spaces.
..... Click the link for more information.
..... Click the link for more information.
Euclidean space. Most of this article is devoted to developing the modern language necessary for the conceptual leap to higher dimensions.
An essential property of a Euclidean space is its flatness. Other spaces exist in geometry that are not Euclidean.
..... Click the link for more information.
An essential property of a Euclidean space is its flatness. Other spaces exist in geometry that are not Euclidean.
..... Click the link for more information.
polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by an angle and a distance. The polar coordinate system is especially useful in situations where the relationship between two points is most easily expressed in terms of
..... Click the link for more information.
..... Click the link for more information.
In mathematics, the absolute value (or modulus[1]) of a real number is its numerical value without regard to its sign. So, for example, 3 is the absolute value of both 3 and −3.
..... Click the link for more information.
..... Click the link for more information.
Maple is a general-purpose commercial mathematics software package. It was first developed in 1980 by the Symbolic Computation Group at the University of Waterloo in Waterloo, Ontario, Canada.
Since 1988, it has been developed and sold commercially by Waterloo Maple Inc.
..... Click the link for more information.
Since 1988, it has been developed and sold commercially by Waterloo Maple Inc.
..... Click the link for more information.
Expand article, tagged for improvement in January 2007,date January 2007
CAD CAM is an abbrieviation of computer-aided design and computer aided manufacturing. CAD
Computer Aided Design CAD this system uses something called TTUA is the use of a wide range of tools that
..... Click the link for more information.
CAD CAM is an abbrieviation of computer-aided design and computer aided manufacturing. CAD
Computer Aided Design CAD this system uses something called TTUA is the use of a wide range of tools that
..... Click the link for more information.
Expand article, tagged for improvement in January 2007,date January 2007
CAD CAM is an abbrieviation of computer-aided design and computer aided manufacturing. CAD
Computer Aided Design CAD this system uses something called TTUA is the use of a wide range of tools that
..... Click the link for more information.
CAD CAM is an abbrieviation of computer-aided design and computer aided manufacturing. CAD
Computer Aided Design CAD this system uses something called TTUA is the use of a wide range of tools that
..... Click the link for more information.
In statistics, Mahalanobis distance is a distance measure introduced by P. C. Mahalanobis in 1936. It is based on correlations between variables by which different patterns can be identified and analysed.
..... Click the link for more information.
..... Click the link for more information.
Taxicab geometry, considered by Hermann Minkowski in the 19th century, is a form of geometry in which the usual metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the (absolute) differences of their coordinates.
..... Click the link for more information.
..... Click the link for more information.
String metrics (also known as similarity metrics) are a class of textual based metrics resulting in a similarity or dissimilarity (distance) score between two pairs of strings for approximate matching or comparison and in fuzzy string searching.
..... Click the link for more information.
..... Click the link for more information.
In mathematics, a metric or distance function is a function which defines a distance between elements of a set. A set with a metric is called a metric space. A metric induces a topology on a set but not all topologies can be generated by a metric.
..... Click the link for more information.
..... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.




