* Test updating the state after the X acceleration falls below the minimum
* acceleration.
*/
public void testUpdateStateSlowX() {
DefaultMomentum momentum = new DefaultMomentum();
State state = momentum.createState(new Point(0.0, 0.0), new Point(0.005, 1.0));
state.setPosition(new Point(0.2, 0.1));
state.setCumulativeElapsedMillis(10);
state.setElapsedMillis(5);
assertTrue(momentum.updateState(state));
// Check the new velocity.
Point velocity = state.getVelocity();
assertEquals(0.0025, velocity.getX(), 0.0001); // 0.005 - 0.0005 * 5
assertEquals(0.99302, velocity.getY(), 0.000009); // 1.0 * .9993 ^ 10
// Check the new position.
Point position = state.getPosition();
assertEquals(0.2125, position.getX(), 0.0001); // .2 + v * 5ms
assertEquals(5.0651, position.getY(), 0.0001); // .1 + v * 5ms
}