]> git.gag.com Git - debian/openrocket/commit
Fixed problems in computation of SymmetricComponent.integrate found by new unit tests...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 23 Apr 2012 17:51:50 +0000 (17:51 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 23 Apr 2012 17:51:50 +0000 (17:51 +0000)
commitb4d058f49c3241d99f090e2892f36a3ed9804666
treea42528dcdd0e5eeff343d39b1466def29a80eae2
parentbbdee22fa55e55e35ebf59e98a85d2ca4b549d18
Fixed problems in computation of SymmetricComponent.integrate found by new unit tests.  There were two problems with the previous code.  First due to rounding errors, it was possible during the last iteration, the right end point (x+l) was beyond the overall length of the component.  This resulted in a zero 0 being used for r2 throwing off the overall computation of volume.  The second problem was for hollow components.  The test for when to switch from using filled to hollow was incorrect because it was comparing r to thickness.  However, thickness is normal to the surface of the component so this test overestimated the total volume of the component.

After making these computation changes, the tests for the density computation in  NoseConePresetTests and TransitionPresetTests could be tightened.

git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@590 180e2498-e6e9-4542-8430-84ac67f01cd8
core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java
core/test/net/sf/openrocket/preset/NoseConePresetTests.java
core/test/net/sf/openrocket/preset/TransitionPresetTests.java
core/test/net/sf/openrocket/rocketcomponent/SymmetricComponentVolumeTest.java [new file with mode: 0644]