How to add inertia to animations tracking mouse move?
I'm trying to rotate a triangle around an origin point using mouseMove event. I'm getting the touch start point and the current touch point using touchstart and touchmove events, then I'm finding the angle of direction easily using: alpha = y2 - y1 / x2 - x1; // alpha is the tangent of the angle beta= atan(alpha); // beta is the angle in radians Then I'm rotating the element in PIXI : function animTriangle (beta) { // initially clear the previous shape myTriangle.clear(); // draw a new shape in new positions myTriangle.beginFill(0x000000, 0.1); myTriangle.moveTo(origin.x, origin.y); myTriangle