# HG changeset patch # User Michiel Broek # Date 1587046104 -7200 # Node ID a5d9ec7e2239a5e692ae6d0f76bf717eb6f979de # Parent 6e89cb158153b1bbec0dea6f0a3104b19cd8fdcd Changed sg to plato and plato to sg formulas to the ones from Brew by the Numbers. diff -r 6e89cb158153 -r a5d9ec7e2239 www/js/global.js --- a/www/js/global.js Wed Apr 15 20:18:00 2020 +0200 +++ b/www/js/global.js Thu Apr 16 16:08:24 2020 +0200 @@ -1049,13 +1049,15 @@ function sg_to_plato(sg) { - return ((135.997 * sg - 630.272) * sg + 1111.14) * sg - 616.868; +// return ((135.997 * sg - 630.272) * sg + 1111.14) * sg - 616.868; + return -668.962 + (1262.45 * sg) - (776.43 * sg * sg) + (182.94 * sg * sg * sg); } function plato_to_sg(plato) { - return 1 + (plato / (258.6 - ((plato / 258.2) * 227.1))); +// return 1 + (plato / (258.6 - ((plato / 258.2) * 227.1))); + return 1.00001 + (0.0038661 * plato) + (1.3488e-5 * plato * plato) + (4.3074e-8 * plato * plato * plato); }