When determining worst-case CP, only consider cases where the CP's weight is non-zero
This commit is contained in:
		
							parent
							
								
									51b2f7a03f
								
							
						
					
					
						commit
						2d9239fe5b
					
				| @ -4,6 +4,7 @@ import java.util.Map; | |||||||
| 
 | 
 | ||||||
| import net.sf.openrocket.rocketcomponent.FlightConfiguration; | import net.sf.openrocket.rocketcomponent.FlightConfiguration; | ||||||
| import net.sf.openrocket.rocketcomponent.RocketComponent; | import net.sf.openrocket.rocketcomponent.RocketComponent; | ||||||
|  | import net.sf.openrocket.util.MathUtil; | ||||||
| import net.sf.openrocket.util.Coordinate; | import net.sf.openrocket.util.Coordinate; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -62,7 +63,7 @@ public abstract class AbstractAerodynamicCalculator implements AerodynamicCalcul | |||||||
| 		for (int i = 0; i < DIVISIONS; i++) { | 		for (int i = 0; i < DIVISIONS; i++) { | ||||||
| 			cond.setTheta(2 * Math.PI * i / DIVISIONS); | 			cond.setTheta(2 * Math.PI * i / DIVISIONS); | ||||||
| 			cp = getCP(configuration, cond, warnings); | 			cp = getCP(configuration, cond, warnings); | ||||||
| 			if (cp.x < worst.x) { | 			if ((cp.weight > MathUtil.EPSILON) && (cp.x < worst.x)) { | ||||||
| 				worst = cp; | 				worst = cp; | ||||||
| 				theta = cond.getTheta(); | 				theta = cond.getTheta(); | ||||||
| 			} | 			} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user