Add support for swipe gestures from lpm state

It was, until I decided not to add -lm just for that ;-)

But, yes maybe using standard math.h functions would be lesser evil.