taxicabDistanceTo method

double taxicabDistanceTo(
  1. Vector2 other
)

Distance to other vector, using the taxicab (L1) geometry.

Implementation

double taxicabDistanceTo(Vector2 other) {
  return (x - other.x).abs() + (y - other.y).abs();
}