missed reversing the operands in the calculation of last bit of impulse

This commit is contained in:
Joe Pfeiffer 2018-08-27 09:16:16 -06:00
parent d2cdea2113
commit 7a04bd567c

View File

@ -334,7 +334,7 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
// Now add the bit after the last time index
if ( timeIndex < time.length -1 ) {
double endThrust = MathUtil.map( endTime, time[timeIndex], time[timeIndex+1], thrust[timeIndex], thrust[timeIndex+1]);
impulse += ((thrust[timeIndex] + endThrust) / 2.0) * (endTime - time[timeIndex]);
impulse += (endTime - time[timeIndex]) * (thrust[timeIndex] + endThrust) / 2.0;
}
return impulse / (endTime - startTime);