www/includes/formulas.php

changeset 653
aa25efa1d629
parent 544
f3faa54581ff
child 655
f4e00869f39f
--- 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);
 }
 
 

mercurial