/* $Id: refract.c,v 1.3 2004/02/26 01:12:07 grog Exp $ */ /* Print a table of refractive index against Brix/Plato */ #include #include #include #include #include #include #include #include #include #include #include #include "beer.h" int main (int argc, char *argv []) { int pct; double brix; double sg; if (argc > 1) { fprintf (stderr, "No arguments, please\n"); return 1; } printf ("In the USA, home brewers describe the potential sugar content of a\n" "grain or sugar with a unit called \"PPG\", which stands for \"Points per\n" "Pound per Gallon\". This is the number of \"points\" (grams per litre)\n" "by which the density of a wort created with one (US) pound of the\n" "grain in one (US) gallon of water exceeds the density of water. It is\n" "not portable to any other system.\n" "\n" "The rest of the world measures the potential sugar in percent. While\n" "the PPG system might appear quaint, even strange, it is still used.\n" "The following table gives conversion factors to percentage sugar.\n\n" "%% sugar\tPPG\n\n"); for (pct = 2; pct <= 100; pct += 2) { brix = pct / 9; sg = Plato_to_SG (brix); printf ("%3d\t%6.4f\n", pct, sg ); } printf ("\n"); return 0; }