May or may not be using this for a future pen platformer.
griffpatch for the formula to make it undulate.