correct linear interpolation of motor CG

This commit is contained in:
JoePfeiffer 2021-01-22 10:54:06 -07:00 committed by Billy Olsen
parent 519379cf56
commit 1942f70b67

View File

@ -563,11 +563,11 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
return cg[ (int)upperIndex ];
}
// return simple linear interpolation
final Coordinate lowerValue = cg[lowerIndex].multiply(lowerFrac);
final Coordinate upperValue = cg[upperIndex].multiply(upperFrac);
// return simple linear interpolation
return lowerValue.average( upperValue );
return lowerValue.add( upperValue );
}
public int getDataSize() {