import math


def circularity (
        area: float,
        perimeter: float
    ) -> float:
    """ Calculates the circularity shape factor with given area and perimeter.

    Args:
        area (float):
            area of a shape
        perimeter (float):
            length of the perimeter of a shape

    Returns:
        A float with the circularity shape factor as value
    """
    if perimeter == 0:
        return 0.0
    return (4 * math.pi * area) / (perimeter ** 2)