private void setAcceleration(double value) { double percentage = 1.0; while (Math.Abs(VesselController.getEnginesAccelerationPrediction(percentage) - value) > 0.1) { percentage -= (VesselController.getEnginesAccelerationPrediction(percentage) - value) * 0.01f; percentage = clamp(percentage, 0.0f, 1.0f); //Console.WriteLine("TWR: {0}, Percentage {1}", calculateAcceleration(), percentage); } VesselController.setThrustPercentage(percentage); }