Using LibGDX + Box2D and my understanding of the answer posted from this question: Here
I apply the following impulse:
// modify sprite's Box2d Body object
int a = 8; // amplitude
int f = 1; // frequency
int p = 1; // phase
float value = (float) ( a * Math.sin( 2 * Math.PI *f * TimeUtils.millis() + p ) );
body.applyLinearImpulse( 0, value, body.getPosition().x, body.getPosition().y, false );
// render it
sprite.setPosition( body.getPosition().x, body.getPosition().y );
sprite.draw( spriteBatch );
But this just causes my sprite to go straight up and offscreen rather than doing a wave. What part of the algorithm am I doing wrong?