public static function calculate(
        float $firstLatitude,
        float $firstLongitude,
        float $secondLatitude,
        float $secondLongitude,
        int $digits = 0,
        int $earthRadius = self::EARTH_RADIUS_IN_KM
    ): float {
        $oneRad = ((2 * M_PI) / 360);

        return \round(
            \sqrt(
                (($oneRad * ($firstLatitude - $secondLatitude) * $earthRadius) ** 2)
                + (($oneRad * ($firstLongitude - $secondLongitude) * $earthRadius
                    * \cos($oneRad * ($firstLatitude + $secondLatitude) * .5)) ** 2)
            ),
            $digits
        );
    }