# HG changeset patch # User Michiel Broek # Date 1587060842 -7200 # Node ID aa25efa1d629938f89b21c670c75a9df163d956c # Parent a5d9ec7e2239a5e692ae6d0f76bf717eb6f979de Changed the sg/plato formulas in the php scripts. diff -r a5d9ec7e2239 -r aa25efa1d629 www/includes/formulas.php --- a/www/includes/formulas.php Thu Apr 16 16:08:24 2020 +0200 +++ b/www/includes/formulas.php Thu Apr 16 20:14:02 2020 +0200 @@ -115,17 +115,19 @@ function sg_to_plato($sg) { - if ($sg > 0.5) - return 259 - 259 / $sg; - return 0; +// if ($sg > 0.5) +// return 259 - 259 / $sg; +// return 0; + return -668.962 + (1262.45 * $sg) - (776.43 * $sg * $sg) + (182.94 * $sg * $sg * $sg); } function plato_to_sg($plato) { - if ($plato < 259) - return 259 / (259 - $plato); - return 1.000; +// if ($plato < 259) +// return 259 / (259 - $plato); +// return 1.000; + return 1.00001 + (0.0038661 * $plato) + (1.3488e-5 * $plato * $plato) + (4.3074e-8 * $plato * $plato * $plato); }