def air_density(t: float, humidity: float, atmospheric_pressure: float,
                pierce: float, AIR_CONST=287.031,
                WATER_CONST=461.521) -> float:
    """Calculates the air density.

    Args:
        t (float): Air temperature [K].
        humidity (float): Air humidity [%].
        atmospheric_pressure (float): Atmospheric pressure [Pa].
        pierce (float): Pierce.
        AIR_CONST (float, optional): Gas constant for air [J/K/kg].
                                        Defaults to 287.031.
        WATER_CONST (float, optional): Gas constant for water vapor [J/K/kg].
                                        Defaults to 461.521.

    Returns:
        float: Air density [kg/(m^3)]
    """
    return atmospheric_pressure / (AIR_CONST * t) \
        - (1 / AIR_CONST - 1 / WATER_CONST) * humidity / 100 * pierce / t