|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.lsh.families.CityBlockDistance
public class CityBlockDistance
This distance measure calculates the city block distance between two vectors. This distance metric also known as the Manhattan distance or L1 distance. Wikipedia calls it "Taxicab geometry":
Taxicab geometry, considered by Hermann Minkowski in the 19th century, is a form of geometry in which the usual distance function or 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. The taxicab metric is also known as rectilinear distance, L1 distance or norm (see Lp space), city block distance, Manhattan distance, or Manhattan length, with corresponding variations in the name of the geometry. The latter names allude to the grid layout of most streets on the island of Manhattan, which causes the shortest path a car could take between two intersections in the borough to have length equal to the intersections' distance in taxicab geometry.
Constructor Summary | |
---|---|
CityBlockDistance()
|
Method Summary | |
---|---|
double |
distance(Vector one,
Vector other)
Calculate the distance between two vectors. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CityBlockDistance()
Method Detail |
---|
public double distance(Vector one, Vector other)
DistanceMeasure
distance
in interface DistanceMeasure
one
- The first vector.other
- The other vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |