public function get(D\Calculator\CalculatorInterface $calculator = null, D\Converter\ConverterInterface $unit_converter = null) {
        if (is_null($calculator)) {
            $calculator = new D\Calculator\Vincenty;
        }

        $distance = $calculator->calculate($this->point1, $this->point2);

        if (!is_null($unit_converter)) {
            $distance = $unit_converter->convert($distance);
        }
        return $distance;
    }
public function get(D\Calculator\CalculatorInterface $calculator = null, D\Converter\ConverterInterface $unit_converter = null) {
        if (is_null($calculator)) {
            $calculator = new D\Calculator\Vincenty;
        }

        $distance = $calculator->calculate($this->point1, $this->point2);

        if (!is_null($unit_converter)) {
            $distance = $unit_converter->convert($distance);
        }
        return $distance;
    }
public function get ( D \ Calculator \ CalculatorInterface $ calculator = null , D \ Converter \ ConverterInterface $ unit_converter = null ) { if ( is_null ( $ calculator ) ) { $ calculator = new D \ Calculator \ Vincenty ; } $ distance = $ calculator -> calculate ( $ this -> point1 , $ this -> point2 ) ; if ( ! is_null ( $ unit_converter ) ) { $ distance = $ unit_converter -> convert ( $ distance ) ; } return $ distance ; }
Calculate the distance between two points. Defaults to Vincenty if
no calculator is supplied. If no unit converter is supplied then the
formula will return a value in metres.
@param D\Calculator\CalculatorInterface $calculator
@param D\Calculator\ConverterInterface $unit_converter
@return float
Calculate the distance between two points . Defaults to Vincenty if no calculator is supplied . If no unit converter is supplied then the formula will return a value in metres .