diff --git a/include/sim.h b/include/sim.h index e156e66..e8aa8d6 100644 --- a/include/sim.h +++ b/include/sim.h @@ -87,12 +87,6 @@ void burnStartTimeCalc(struct sVars &Vars) { } void thrustSelection(struct sVars &Vars, int t) { - // TODO: Determine a real tolerance - double tol = 0.001; // 0.001 seems to be a nice tolerance - - // Check to see if current velocity is close to the F15's total velocity - bool b_burnStart = (Vars.burnVelocity < (1 + tol) * Vars.vz * -1) & - (Vars.burnVelocity > (1 - tol) * Vars.vz * -1); if (Vars.burnElapsed != 2000) { // determine where in the thrust curve we're at based on elapsed burn time @@ -101,7 +95,7 @@ void thrustSelection(struct sVars &Vars, int t) { Vars.mass = Vars.massInitial - (Vars.mdot * Vars.burnElapsed); } - else if (b_burnStart) { + else if (abs(Vars.burnVelocity - Vars.vz) < .001) { // Start burn Vars.burnStart = t; Vars.burnElapsed = 0;