Home▸Articles▸Computer Science

Directional Swipe-Card Physics: 2D Vector Gesture Decision

Understanding how swipe gestures are processed in interactive applications.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What is a Directional Swipe-Card?

A directional swipe-card is an interactive element often seen in applications like Tinder or Netflix, where users can drag a card to make decisions. The card's movement triggers specific actions based on the direction and distance of the swipe.

In this simulation, you control the card’s motion with your pointer, which demonstrates how these gestures are translated into discrete outcomes such as 'like' or 'dislike'.

Thresholds for Dismiss Decisions

The dismiss decision is made based on either a Euclidean distance threshold or a velocity-vector magnitude threshold. The former determines if the card has moved far enough to be considered dismissed, while the latter checks the speed of the swipe.

These thresholds are crucial in ensuring that user interactions are accurately interpreted and acted upon by the application.

live demo · related simulation● LIVE

Fling vs Spring-Back

When a swipe exceeds the dismiss threshold but does not reach the fling velocity, the card undergoes a fling. This is a smooth transition where the card moves at a constant vector deceleration until it comes to rest.

If the swipe velocity surpasses the fling threshold, the card experiences a critically-damped spring-back, which brings the card back to its original position with minimal overshoot and oscillations.

Kinematics of 2D Motion

The kinematics of 2D motion in this simulation are governed by Newton's laws of motion. The x/y coordinates of the card change over time, influenced by initial velocity, deceleration, and external forces.

Independently verifying the x/y kinematics ensures that the physics engine accurately models real-world behavior.

Frequently asked questions

How does the Euclidean distance threshold work?

The Euclidean distance threshold measures the straight-line distance between the card's starting and ending positions. If this distance exceeds a certain percentage of the arena radius, it is considered a dismiss action.

What happens if I exceed both thresholds during a swipe?

If you exceed both the dismiss threshold and the fling velocity threshold, the card will undergo a critically-damped spring-back to its original position with minimal overshoot and oscillations.

Can I adjust the deceleration rate for the fling?

Yes, you can set the exit deceleration using the slider. This controls how quickly the card slows down during a fling, ensuring smooth transitions based on your preference or application requirements.

Why is critically-damped spring-back important in interactive applications?

Critically-damped spring-back ensures that the card returns to its original position without overshooting and oscillating excessively, providing a more natural and satisfying user experience.

Try it live

Everything above runs in your browser — open Directional Swipe-Card Physics: 2D Vector Gesture Decision and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Directional Swipe-Card Physics: 2D Vector Gesture Decision simulation

What did you find?

Add reproduction steps (optional)