public function distance(Geo $other)
    {
        if ($other === $this) {
            return 0.0;
        } else {
            return self::DEG_KM * rad2deg(
                acos(
                    (sin(deg2rad($this->latitude)) * sin(deg2rad($other->latitude))) +
                    (cos(deg2rad($this->latitude)) * cos(deg2rad($other->latitude)) * cos(deg2rad($this->longitude - $other->longitude)))
                )
            );
        }
    }
public function distance(Geo $other)
    {
        if ($other === $this) {
            return 0.0;
        } else {
            return self::DEG_KM * rad2deg(
                acos(
                    (sin(deg2rad($this->latitude)) * sin(deg2rad($other->latitude))) +
                    (cos(deg2rad($this->latitude)) * cos(deg2rad($other->latitude)) * cos(deg2rad($this->longitude - $other->longitude)))
                )
            );
        }
    }
public function distance ( Geo $ other ) { if ( $ other === $ this ) { return 0.0 ; } else { return self :: DEG_KM * rad2deg ( acos ( ( sin ( deg2rad ( $ this -> latitude ) ) * sin ( deg2rad ( $ other -> latitude ) ) ) + ( cos ( deg2rad ( $ this -> latitude ) ) * cos ( deg2rad ( $ other -> latitude ) ) * cos ( deg2rad ( $ this -> longitude - $ other -> longitude ) ) ) ) ) ; } }
Uses the Haversine formula to calculate kilometer point distance.

@param \Libreworks\Microformats\Geo $other
@return float The distance
Uses the Haversine formula to calculate kilometer point distance .