血液酒精含量计算器
根据饮酒量、体重和时间估算血液酒精含量(BAC)。
关于此工具
血液酒精含量(BAC)是衡量血液中酒精百分比的指标,也是判断酒精中毒程度的关键指标。本BAC计算器根据您摄入的酒精量、体重、性别和开始饮酒以来的时间,估算您的血液酒精含量。了解您的估计BAC有助于您做出明智的决定,判断驾驶、操作机器或从事其他需要精神集中的活动是否安全。
要使用本计算器,请输入您摄入的标准饮料数量、体重、选择性别(性别会影响酒精代谢),以及开始饮酒以来的时间。计算器采用法医科学和公共卫生领域广泛认可的维德马克公式来估算BAC。请注意,这只是一个估计值——实际的BAC会因食物摄入、代谢速率、酒精强度和水分含量等因素而异。
本结果仅供教育和减害目的之用,不应作为法律辩护或呼吸测试的替代品。许多司法管辖区都规定了法定驾驶限制(许多国家为0.08%),而警方的呼吸检测仪是唯一可靠的执法手段。始终把安全放在首位:如果您已经喝过酒,应使用出租车、代驾或拼车服务,而不是依赖估算值。
常见问题
代码实现
def calculate_bac(
drinks: list[dict],
weight_kg: float,
gender: str,
hours_elapsed: float
) -> float:
"""
Estimate Blood Alcohol Content using the Widmark formula.
BAC = (alcohol_grams / (weight_kg * r * 10)) - (0.015 * hours)
r = 0.68 for male, 0.55 for female
drinks: list of {"abv": float (%), "volume_ml": float}
WARNING: For estimation only. Never use to determine fitness to drive.
"""
r = 0.68 if gender.lower() == "male" else 0.55
total_alcohol_grams = sum(
d["volume_ml"] * (d["abv"] / 100) * 0.789 # ethanol density = 0.789 g/ml
for d in drinks
)
bac = (total_alcohol_grams / (weight_kg * r * 10)) - (0.015 * hours_elapsed)
return max(bac, 0.0)
# Example: 80kg male, 2 beers (5%, 355ml), 1 hour elapsed
drinks = [
{"abv": 5, "volume_ml": 355},
{"abv": 5, "volume_ml": 355},
]
bac = calculate_bac(drinks, weight_kg=80, gender="male", hours_elapsed=1)
print(f"Estimated BAC: {bac:.4f}%") # ~0.0367%
Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.