ManhattanDistance

ManhattanDistance[u,v]

gives the Manhattan or "city block" distance between vectors u and v.

Details

Examples

open allclose all

Basic Examples  (2)

Manhattan distance between two vectors:

Manhattan distance between numeric vectors:

Scope  (2)

Compute distance between any vectors of equal length:

Compute distance between vectors of any precision:

Applications  (2)

Cluster data using Manhattan distance:

Demonstrate the triangle inequality:

Properties & Relations  (5)

Manhattan distance is a sum of absolute differences:

ManhattanDistance is equivalent to a Norm of a difference:

ManhattanDistance is greater than or equal to ChessboardDistance:

BrayCurtisDistance is a ratio of Manhattan distances:

MeanDeviation as a scaled ManhattanDistance from the Mean:

Wolfram Research (2007), ManhattanDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/ManhattanDistance.html.

Text

Wolfram Research (2007), ManhattanDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/ManhattanDistance.html.

CMS

Wolfram Language. 2007. "ManhattanDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ManhattanDistance.html.

APA

Wolfram Language. (2007). ManhattanDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ManhattanDistance.html

BibTeX

@misc{reference.wolfram_2024_manhattandistance, author="Wolfram Research", title="{ManhattanDistance}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ManhattanDistance.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_manhattandistance, organization={Wolfram Research}, title={ManhattanDistance}, year={2007}, url={https://reference.wolfram.com/language/ref/ManhattanDistance.html}, note=[Accessed: 22-December-2024 ]}