A nutrition label is a column of numbers, and eating is a matrix multiplication. Put the labels of three foods side by side to get a 3×3 matrix N: each column is one food, each row is one nutrient (grams per 100 g of that food). If a person eats amounts vA, vB, vC (in units of 100 g), the total nutrients eaten are exactly the product
Nv = total grams of (carb, fat, protein), (Nv)i = NiAvA + NiBvB + NiCvC
Edit any entry (grams per 100 g of food). Column = food, row = nutrient.
| g per 100 g | Food A | Food B | Food C |
|---|---|---|---|
| Carbohydrate | |||
| Fat | |||
| Protein |
Slide to choose how much of each food is eaten. The vector entry is the amount in units of 100 g.
Hover, tap, or focus a result entry to see which numbers produced it: one row of N meets the whole vector v.
Each bar is one nutrient total, split by food. Hover or focus a segment for its term Nij · vj.
Assign an energy factor (kcal/g) to each of the three nutrients. Collect these factors in a row vector c = (ccarb, cfat, cprot). The estimated energy represented by this model is the inner product of c with the nutrient-total vector Nv: c · (Nv) = ccarb(Nv)1 + cfat(Nv)2 + cprot(Nv)3.
| kcal per g | Carbohydrate | Fat | Protein |
|---|---|---|---|
| c |
The default entries 4, 9, and 4 are the Atwater factors.