Merge pull request #652 from JoePfeiffer/fix-648
Avoid considering cp with 0 weight when calculating worst-case CP for display in RocketInfo
This commit is contained in:
commit
91652e7e4f
@ -4,6 +4,7 @@ import java.util.Map;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.util.MathUtil;
|
||||
import net.sf.openrocket.util.Coordinate;
|
||||
|
||||
|
||||
@ -62,7 +63,7 @@ public abstract class AbstractAerodynamicCalculator implements AerodynamicCalcul
|
||||
for (int i = 0; i < DIVISIONS; i++) {
|
||||
cond.setTheta(2 * Math.PI * i / DIVISIONS);
|
||||
cp = getCP(configuration, cond, warnings);
|
||||
if (cp.x < worst.x) {
|
||||
if ((cp.weight > MathUtil.EPSILON) && (cp.x < worst.x)) {
|
||||
worst = cp;
|
||||
theta = cond.getTheta();
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
|
||||
cg = MassCalculator.calculateLaunch( curConfig).getCM();
|
||||
|
||||
if (cp.weight > MassCalculator.MIN_MASS){
|
||||
if (cp.weight > MathUtil.EPSILON){
|
||||
cpx = cp.x;
|
||||
}else{
|
||||
cpx = Double.NaN;
|
||||
|
Loading…
x
Reference in New Issue
Block a user