function cpt(taille, poids, age, sexe){
const f = {
M: {a: -4.73, b: .0776, c: -0.019, d: 0},
F: {a: -6.35, b: .0738, c: 0, d: -0.016}
};
if(taille && poids && age && sexe){
let {a, b, c, d} = f[sexe];
return a + b * taille + c * poids + d * age;
}
}
function VDphys(CPT, Vc, age) {
return -65.2 + 11.6 * CPT + 0.173 * Vc + 1.33 * age;
}
function VDaw(CPT, Vc) {
return 4.9 + 11.3 * CPT + 0.062 * Vc;
}
viewof poids = Inputs.number({label: "Poids (kg)", value: null });
viewof age = Inputs.number({label: 'Âge (Années)', value: null});
viewof vc = Inputs.number({label: 'Volume courant (ml)', value: null});
cptPredite = cpt(taille, poids, age, sexe);
resultSpan(cptPredite, 3, 'CPT prédite', 'l');