Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 141259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:44:52+00:00 2026-05-11T07:44:52+00:00

I was asking myself if there are examples online which covers how you can

  • 0

I was asking myself if there are examples online which covers how you can for instance detect shapes in touch gestures.

for example a rectangle or a circle (or more complex a heart .. )

or determine the speed of swiping (over time ( like i’m swiping my iphone against 50mph ))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:44:53+00:00Added an answer on May 11, 2026 at 7:44 am

    For very simple gestures (horizontal vs. vertical swipe), calculate the difference in x and y between two touches.

    dy = abs(y2 - y1) dx = abs(x2 - x1) f = dy/dx 

    An f close to zero is a horizontal swipe. An f close to 1 is a diagonal swipe. And a very large f is a vertical swipe (keep in mind that dx could be zero, so the above won’t yield valid results for all x and y).

    If you’re interested in speed, pythagoras can help. The length of the distance travelled between two touches is:

    l = sqrt(dx*dx + dy*dy) 

    If the touches happened at times t1 and t2, the speed is:

    tdiff = abs(t2 - t1) s = l/tdiff 

    It’s up to you to determine which value of s you interpret as fast or slow.

    You can extend this approach for more complex figures, e.g. your square shape could be a horizontal/vertical/horizontal/vertical swipe with start/end points where the previous swipe stopped.

    For more complex figures, it’s probably better to work with an idealized shape. One could consider a polygon shape as the ideal, and check if a range of touches

    1. don’t have too high a distance to their closest point on the pologyon’s outline, and
    2. all touches follow the same direction along the polygon’s outline.

    You can refine things further from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's a same question I keep asking myself each time a new Dependency Injection
How much I dig into JavaScript, I find myself asking that much. For example
I started creating a domain model and now I asking myself, how can I
With c++11 out there, I was asking myself if there is a replacement of
i am asking myself if it is possible to somehow create a dynamic gui
I'm coding an MVVM Silverlight application with MVVMLight. I was asking myself what is
I'm learning Java and find myself sending methods around while asking for help but
I am asking for help, after hours of trying to figure this out myself.
Before asking a question, and before you all get mad because there are a
I'm not even quite sure how I can make myself clear and I do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.