FACTOID # 180: Armenia was the first nation to formally adopt Christianity, and today has one of the few Christian cultures to still sacrifice animals on Sunday.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS   

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > 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. Euclid, Greek mathematician, 3rd century BC, as imagined by by Raphael in this detail from The School of Athens. ... Distance is a numerical description of how far apart objects are at any given moment in time. ... In mathematics, the Pythagorean theorem or Pythagoras theorem is a relation in Euclidean geometry among the three sides of a right triangle. ... In mathematics, a metric space is a set where a notion of distance between elements of the set is defined. ... The mathematical concept of a Hilbert space (named after the German mathematician David Hilbert) generalizes the notion of Euclidean space in a way that extends methods of vector algebra from the plane and three-dimensional space to spaces of functions. ...

Contents

Definition

The Euclidean distance between two points P=(p_1,p_2,dots,p_n), and Q=(q_1,q_2,dots,q_n),, in Euclidean n-space, is defined as: Around 300 BC, the Greek mathematician Euclid laid down the rules of what has now come to be called Euclidean geometry, which is the study of the relationships between angles and distances in space. ...

sqrt{(p_1-q_1)^2 + (p_2-q_2)^2 + cdots + (p_n-q_n)^2} = sqrt{sum_{i=1}^n (p_i-q_i)^2}

One-dimensional distance

For two 1D points, P=(p_x), and Q=(q_x),, the distance is computed as:

sqrt{(p_x-q_x)^2} = | p_x-q_x |

The absolute value signs are used, since distance is normally considered to be an unsigned scalar value.


Two-dimensional distance

For two 2D points, P=(p_x,p_y), and Q=(q_x,q_y),, the distance is computed as:

sqrt{(p_x-q_x)^2 + (p_y-q_y)^2}

Alternatively, expressed in circular coordinates (also known as polar coordinates), using P=(r_1, theta_1), and Q=(r_2, theta_2),, the distance can be computed as: This article describes some of the common coordinate systems that appear in elementary mathematics. ...

sqrt{r_1^2 + r_2^2 - 2 r_1 r_2 cos(theta_1 - theta_2)}

2D approximations for computer applications

A fast approximation of 2D distance based on an octagonal boundary can be computed as follows. Let dx = | pxqx | (absolute value) and dy = | pyqy | . If dy > dx, approximated distance is 0.41, dx + 0.941246, dy . (If dy < dx, 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%. In mathematics, the absolute value (or modulus[1]) of a real number is its numerical value without regard to its sign. ...

The following Maple code implements this approximation and produces the plot on the right, with a true circle in black and the octagonal approximate boundary in red: Maple 9. ...

 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 A is greater than distance B, then A2 will also be greater than B2. Or, when checking to see if distance A is greater than 2B, that is the same as comparing A2 with (2B)2 or 4B2, 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. CAD/CAM is an abbrieviation of computer-aided design and computer-aided manufacturing. ...


Three-dimensional distance

For two 3D points, P=(p_x,p_y,p_z), and Q=(q_x,q_y,q_z),, the distance is computed as

sqrt{(p_x-q_x)^2 + (p_y-q_y)^2+(p_z-q_z)^2}.

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 A is greater than distance B, then A2 will also be greater than B2. 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. CAD/CAM is an abbrieviation of computer-aided design and computer-aided manufacturing. ...


See also


  Results from FactBites:
 
Distance - Wikipedia, the free encyclopedia (963 words)
One might attempt to define the distance between two non-empty subsets of a given set as the infimum of the distances between any two of their respective points, which would agree with the every-day use of the word.
Distance is a scalar quantity, containing only a magnitude, whereas displacement is an equivalent vector quantity containing both magnitude and direction.
The distance covered by a vehicle (often recorded by an odometer), person, animal, object, etc. should be distinguished from the distance from starting point to end point, even if latter is taken to mean e.g.
Euclidean distance - Wikipedia, the free encyclopedia (542 words)
In mathematics, the Euclidean distance or Euclidean metric is the "ordinary" distance between the two points that one would measure with a ruler, which can be proven by repeated application of the Pythagorean theorem.
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.
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.
  More results at FactBites »

 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your location
Your comments
Please enter the 5-letter protection code


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.