FACTOID # 6: Clipperton Island wins our prize for the most unusual looking country.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Euclidean metric

The Euclidean distance of two points x = (x1,...,xn) and y = (y1,...,yn) in Euclidean n-space is computed as

It 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. By using this formula as distance, Euclidean space becomes a metric space (even a Hilbert space).

Contents

Two-dimensional distance

For two 2D points P=[px,py] and Q=[qx,qy], the distance is computed as

Approximation

A fast approximation of 2D distance based on an octagonal boundary can be computed as follows. Let dx = |px-qx| (absolute value) and dy = |py-qy|. If dydx, aproximated distance is 0.41dx+0.941246dy. (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%.

image:fasteuclid.png

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:

 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 - 2Śmin(dx,dy) yields error in interval 0% to 12%. (Attributed to Alan Paeth.)


Three-dimensional distance

For two 3D points P=[px,py,pz] and Q=[qx,qy,qz], the distance is computed as

See also


  Results from FactBites:
 
Metric tensor - Wikipedia, the free encyclopedia (1164 words)
In mathematics, the metric tensor is a symmetric tensor field of rank 2 that is used to measure distance in a space.
is conventionally used for the components of the metric tensor (i.e., the elements of the matrix).
In the later case, the geodesic equations are seen to arise from the principle of least action: they describe the motion of a "free particle" (a particle feeling no forces) that is confined to move on the manifold, but otherwise moves freely, with constant momentum, within the manifold.
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


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, 1022, m