Manhattan distance metric.
Namespace:
AForge.Math.MetricsAssembly: AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
C# |
---|
public sealed class ManhattanDistance : IDistance |
Remarks
This class represents the Manhattan distance metric (aka City Block and Taxi Cab distance).
Sample usage:

// instantiate new distance class ManhattanDistance dist = new ManhattanDistance( ); // create two vectors for inputs double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 }; double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 }; // get distance between the two vectors double distance = dist.GetDistance( p, q );