Point::DistanceL1

Point::DistanceL1
inline T DistanceL1(T x2, T y2) const;
inline T DistanceL1(const Point<T> & pt) const;
Description

DistanceL1 calculates the L1 distance Manhattan style (The sum of the absolute values of the x and y distances) using the equation:

   abs(x1-x2) + abs(y1-y2)

This allows the user to calculate distances while only following the lines of a rectangular grid.

Parameters
Parameters 
Description 
T x2 
The x coordinate of a point whose L1 distance to the current Point will be calculated. 
T y2 
The y coordinate of a point whose L1 distance to the current Point will be calculated. 
const Point<T> & pt 
A point parameter whose x and y coordinates will act as x2 and y2 respectively in the above equation. 
Return Value

A value containing the calculated L1 distance.