import math


def _calc_buffer_resolution(radius: float, detail: float) -> int:
    """Compute the ``resolution`` parameter of Shapely's ``buffer()`` based on the radius
    and desired detail.
    """
    return max(math.ceil(0.5 * math.pi * radius / detail) + 1, 3)