From b1872a8dadd2f87286a8a73bc8664158897563b1 Mon Sep 17 00:00:00 2001 From: NathanKell Date: Sun, 24 May 2015 19:00:33 -0400 Subject: [PATCH] Clarify math. --- Source/Engines/SolverRF.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Engines/SolverRF.cs b/Source/Engines/SolverRF.cs index 7334c57f..fea64916 100644 --- a/Source/Engines/SolverRF.cs +++ b/Source/Engines/SolverRF.cs @@ -70,7 +70,8 @@ public void InitializeOverallEngineData( k1 = t; } float minIsp = 0.0001f; - float maxP = k1.time + (minIsp - k1.value) / (k0.value - k1.value) * (k0.time - k1.time); + float invSlope = (k1.time - k0.time) / (k0.value - k1.value); + float maxP = k1.time + (k1.value - minIsp) * invSlope; atmosphereCurve = new FloatCurve(); atmosphereCurve.Add(k0.time, k0.value, k0.inTangent, k0.outTangent);