def air_density(virtual_temperature_k, pressure_hPa):
    """
    Calculate the density of air based on the ideal gas law, virtual temperature, and pressure.

    Args:
        virtual_temperature_k: The virtual temperature in units K.
        pressure_hPa: The pressure in units hPa.

    Returns:
        The density of air in units kg m-3.
    """
    gas_constant = 287.0
    return pressure_hPa * 100.0 / (gas_constant * virtual_temperature_k)