FocusFlow implements four validated skinfold protocols inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/piratta/gymApp/llms.txt
Use this file to discover all available pages before exploring further.
src/lib/plicometria.ts. This page documents the exact mathematical formulas, site selections, and coefficient tables used by computePlicometriaValues() to transform raw millimetre measurements into actionable body-composition metrics. All results are stored in a PlicometriaLog document in Firestore.
All formulas assume skinfold measurements in millimetres (mm) and bodyweight in kilograms (kg). Body density is expressed in g/cm³.
computePlicometriaValues
The main computation function. It accepts raw skinfold inputs and returns the five derived body-composition values. The correct sub-formula is selected automatically based on protocolId and biologicalSex.
Input parameters
| Parameter | Type | Description |
|---|---|---|
weight | number | Athlete’s bodyweight in kg |
protocolId | string | Skinfold protocol to apply |
biologicalSex | "MALE" | "FEMALE" | Determines which sex-specific coefficients are used |
age | number | Athlete’s age in years at time of measurement |
pectoral … axilarMedio | number? | Individual skinfold measurements in mm (defaults to 0) |
Output
| Field | Type | Description |
|---|---|---|
sumaPliegues | number | Sum of the skinfolds used by the selected protocol (mm) |
densidadCorporal | number | Body density in g/cm³ (5 d.p.) |
porcentajeGrasa | number | Body fat percentage (clamped 2–60%, 2 d.p.) |
masaGrasa | number | Fat mass in kg (2 d.p.) |
masaMagra | number | Lean mass in kg (2 d.p.) |
Jackson-Pollock 3-Fold Protocol ("3-fold")
A three-site Jackson-Pollock equation validated for healthy adults. Site selection differs by biological sex.
Measurement sites:
- Males: Pectoral + Abdominal + Muslo anterior
- Females: Tríceps + Suprailiaco + Muslo anterior
Durnin-Womersley 4-Fold Protocol ("4-fold")
The Durnin-Womersley protocol uses four sites and applies age- and sex-stratified logarithmic regression coefficients to account for fat distribution changes across the lifespan.
Measurement sites: Tríceps + Bíceps + Subescapular + Suprailiaco
Formula:
log10(S) uses Math.log10(Math.max(1, sumaPliegues)) in the implementation to prevent a log(0) domain error when all measurements are zero.Coefficient table
Males:| Age group | C | m |
|---|---|---|
| < 20 | 1.1620 | 0.0630 |
| 20–29 | 1.1631 | 0.0632 |
| 30–39 | 1.1422 | 0.0544 |
| 40–49 | 1.1620 | 0.0700 |
| 50+ | 1.1715 | 0.0779 |
| Age group | C | m |
|---|---|---|
| < 20 | 1.1549 | 0.0678 |
| 20–29 | 1.1599 | 0.0717 |
| 30–39 | 1.1423 | 0.0632 |
| 40–49 | 1.1333 | 0.0612 |
| 50+ | 1.1339 | 0.0645 |
Jackson-Pollock 7-Fold Protocol ("7-fold")
The most comprehensive Jackson-Pollock protocol, using seven measurement sites for greater accuracy across a wider range of body compositions.
Measurement sites: Pectoral + Axilar medio + Tríceps + Subescapular + Abdominal + Suprailiaco + Muslo anterior
Where S = sum of all seven skinfolds in mm and D = body density.
Males formula:
Yuhasz Protocol ("yuhasz")
The Yuhasz protocol bypasses body density entirely, computing body fat percentage directly from the sum of six skinfolds with sex-specific linear regression equations.
Measurement sites: Pectoral + Subescapular + Tríceps + Abdominal + Suprailiaco + Muslo anterior
Males:
Because Yuhasz produces
%Fat directly, densidadCorporal remains at its default value of 1.0 in the returned object — the Siri formula is not applied for this protocol.Siri Formula — Body Density → Body Fat %
For the 3-fold, 4-fold, and 7-fold protocols, FocusFlow converts body density to body fat percentage using the classic Siri (1956) two-compartment model:Clamping
After the percentage is computed (via Siri or Yuhasz), the result is clamped to a physiologically safe range to guard against extreme outliers caused by measurement error:Derived Values
OnceporcentajeGrasa is finalised, fat and lean masses are computed from the athlete’s bodyweight:
calculateAgeAtDate
A helper function used internally to compute the athlete’s exact age in whole years at the time a plicometría log is recorded. This ensures the age-dependent terms in the 3-fold, 4-fold, and 7-fold formulas reflect the athlete’s age on the day of measurement rather than their current age.
Parameters
| Parameter | Type | Description |
|---|---|---|
birthDateStr | string | Athlete’s date of birth in YYYY-MM-DD format |
logDateStr | string | Date of the plicometría log in YYYY-MM-DD format |
Return value
The athlete’s age in whole years on the log date. Returns 30 as a safe default if either date string is missing or cannot be parsed.Logic
m < 0 || (m === 0 && date < birthDate)) ensures athletes whose birthday falls later in the measurement year are not counted as a year older than they actually are.
The default fallback of 30 is a deliberate choice: it sits near the centre of most adult training populations, minimising systematic error in age-dependent terms when birth date data is unavailable.