public function distance(Vector $that, int $type = null) : float
    {
        if (null === $type) {
            $type = static::$defaultDistanceType;
        }

        switch ($type) {
            case self::DISTANCE_CARTESIAN:
                return $this->cartesianDistanceTo($that);

            case self::DISTANCE_CHEBYSHEV:
            case self::DISTANCE_CHESSBOARD:
                return $this->chebyshevDistanceTo($that);

            case self::DISTANCE_TAXICAB:
            case self::DISTANCE_MANHATTAN:
                return $this->taxicabDistanceTo($that);
        }

        throw new \InvalidArgumentException('Unsupported distance type ['.$type.'] given.');
    }