]> git.gag.com Git - sw/motorsim/commitdiff
Fixed error in side view
authorBill Kuker <bkuker@billkuker.com>
Wed, 15 Apr 2009 18:27:59 +0000 (18:27 +0000)
committerBill Kuker <bkuker@billkuker.com>
Wed, 15 Apr 2009 18:27:59 +0000 (18:27 +0000)
Fixed error in area calc - was double counting ends

src/com/billkuker/rocketry/motorsim/grain/CoredCylindricalGrain.java

index cc67b0bf2cb7e75e50ff22d178246551de85569a..f0d94f69b11a8c663a5e8f5861ea786926d1b3d4 100644 (file)
@@ -66,9 +66,9 @@ public class CoredCylindricalGrain extends ExtrudedGrain implements MotorPart.Va
                \r
                Amount<Area> outer = cOD.times(Math.PI).times(cLength).to(SI.SQUARE_METRE);\r
                \r
-               Amount<Area> ends = (cOD.divide(2).pow(2).times(Math.PI)).minus(cID.divide(2).pow(2).times(Math.PI)).times(2).to(SI.SQUARE_METRE);\r
+               Amount<Area> end = (cOD.divide(2).pow(2).times(Math.PI)).minus(cID.divide(2).pow(2).times(Math.PI)).to(SI.SQUARE_METRE);\r
                \r
-               Amount<Area> total = inner.times(innerSurfaceInhibited?0:1).plus(outer.times(outerSurfaceInhibited?0:1)).plus(ends.times(numberOfBurningEnds(regression)));\r
+               Amount<Area> total = inner.times(innerSurfaceInhibited?0:1).plus(outer.times(outerSurfaceInhibited?0:1)).plus(end.times(numberOfBurningEnds(regression)));\r
                \r
                return total;\r
        }\r
@@ -214,7 +214,7 @@ public class CoredCylindricalGrain extends ExtrudedGrain implements MotorPart.Va
                if ( isForeEndInhibited() && !isAftEndInhibited() )\r
                        top = -length/2;\r
                else if ( isAftEndInhibited() && !isForeEndInhibited() )\r
-                       top = length-lmm;\r
+                       top = length/2-lmm;\r
                \r
                a.add( new java.awt.geom.Area(new Rectangle2D.Double(-oDmm/2,top,oDmm, lmm)));\r
                a.subtract( new java.awt.geom.Area(new Rectangle2D.Double(-iDmm/2,-length/2,iDmm, length)));\r