public function distanceFrom(LatLng $coord)
    {
        $latDist = abs($this->getLat() - $coord->getLat());
        $lngDist = abs($this->getLng() - $coord->getLng());

        $radDist = deg2rad(sqrt(pow($latDist, 2) + pow($lngDist, 2)));

        return $radDist * UnitsType::EARTH_RADIUS;
    }
public function distanceFrom(LatLng $coord)
    {
        $latDist = abs($this->getLat() - $coord->getLat());
        $lngDist = abs($this->getLng() - $coord->getLng());

        $radDist = deg2rad(sqrt(pow($latDist, 2) + pow($lngDist, 2)));

        return $radDist * UnitsType::EARTH_RADIUS;
    }
public function distanceFrom ( LatLng $ coord ) { $ latDist = abs ( $ this -> getLat ( ) - $ coord -> getLat ( ) ) ; $ lngDist = abs ( $ this -> getLng ( ) - $ coord -> getLng ( ) ) ; $ radDist = deg2rad ( sqrt ( pow ( $ latDist , 2 ) + pow ( $ lngDist , 2 ) ) ) ; return $ radDist * UnitsType :: EARTH_RADIUS ; }
Very approximate calculation of the distance in kilometers between two coordinates

@param LatLng $coord

@return float
Very approximate calculation of the distance in kilometers between two coordinates