// Mifflin-St Jeor equation for Basal Metabolic Rate // Most accurate BMR formula validated by research (Mifflin et al., 1990) // // Males: BMR = 10 * weight(kg) + 6.25 * height(cm) - 5 * age(years) - 5 // Females: BMR = 10 * weight(kg) + 6.25 * height(cm) - 5 * age(years) + 161 export function calculateBmr(weightKg, heightCm, age, sex) { const base = 10 * weightKg + 6.25 * heightCm - 5 * age; return Math.round(sex === "m" ? base - 5 : base + 161); } export function getAge(birthYear) { return new Date().getFullYear() - birthYear; }