🛠️ToolsShed

Calculadora de índice cintura-cadera

Calcula tu ICE y evalúa el riesgo de salud según las pautas de la OMS.

WHO Risk Categories

Waist-to-Hip Ratio thresholds

SexLowModerateHighVery High
Male<0.900.90–0.950.95–1.00≥1.00
Female<0.800.80–0.850.85–0.90≥0.90

Preguntas Frecuentes

Implementación de Código

def waist_to_hip_ratio(waist_cm, hip_cm):
    """
    Calculate Waist-to-Hip Ratio (WHR).

    Parameters:
        waist_cm - waist circumference in centimetres
        hip_cm   - hip circumference in centimetres

    Returns WHR as a float.
    """
    if hip_cm <= 0:
        raise ValueError("Hip circumference must be greater than 0")
    return waist_cm / hip_cm

def whr_risk(whr, gender):
    """
    Classify WHR health risk using WHO thresholds.

    gender: 'male' or 'female'
    Returns: 'Low', 'Moderate', or 'High'
    """
    if gender.lower() == 'male':
        if whr < 0.90:  return 'Low'
        if whr < 1.00:  return 'Moderate'
        return 'High'
    else:  # female
        if whr < 0.80:  return 'Low'
        if whr < 0.85:  return 'Moderate'
        return 'High'

def waist_height_ratio(waist_cm, height_cm):
    """
    Waist-to-Height Ratio (WHtR) — supplementary metric.
    Health threshold: < 0.5 for all adults.
    """
    return waist_cm / height_cm

# Examples
whr = waist_to_hip_ratio(85, 98)
print(f"WHR:      {whr:.2f}")
print(f"Risk (M): {whr_risk(whr, 'male')}")
print(f"Risk (F): {whr_risk(whr, 'female')}")
print(f"WHtR:     {waist_height_ratio(85, 175):.2f}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.