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

  • Home
  • SEARCH
  • 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 1080281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:00:20+00:00 2026-05-16T22:00:20+00:00

I need an algorithm to calculate, numerically, the degree of similarity between two drawn

  • 0

I need an algorithm to calculate, numerically, the degree of similarity between two drawn lines. The lines are drawn using a mouse, and are stored as a set of cartesian coordinates before being filtered and smoothed using separate algorithms.

For example, within the following diagram:
diagram

Lines A and B are clearly similar, but B and C are not. The algorithm should reflect this. Additionally, the ‘direction’ of the line, as indicated by the start and end points, matters. Does such an algorithm already exist?

  • 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. Editorial Team
    Editorial Team
    2026-05-16T22:00:21+00:00Added an answer on May 16, 2026 at 10:00 pm

    A naive approach can be taking the sum of the distances between the corresponding points on the two lines.So lets assume both of the lines are of almost same length and the number of points on the lines are approximately same and equidistant.
    1.Translate the line 2 so that its start point is same as line 1’s starting point.
    2. calculate the sum of distances between corresponding points between line 1 and line2.
    3. If average distance (i.e. SUM/NUMBER_OF_POINTS) is lesser than the THRESHOLD then lines are similar otherwise they are different.
    This can be extended to support lines with different sizes. In that case, just enlarge the smaller line to match up to the longer line, then rest can be similar to the above approach.
    Apart from calculating the distance you can calculate the difference of the slopes of the lines and if different in slopes at any point (or few points, you need to some experiment for this) is way to high (above than some THRESHOLD) then they are not similar.

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

Sidebar

Related Questions

I need the perfect algorithm or C# function to calculate the difference (distance) between
I need a reasonably smart algorithm to come up with nice grid lines for
I need an recursive algorithm to calculate determinant of n*n matrix.
Need a running (moving, rolling) average algorithm to calculate the 5-minute average bits that
Is there a good algorithm to calculate the cartesian product of three seq s
I need an algorithm that converts an arbitrarily sized unsigned integer (which is stored
I need an algorithm to determine if a sentence, paragraph or article is negative
I need a quick algorithm to select 5 random elements from a generic list.
I need an example algorithm that will draw pixels one at a time on
When I need some complex algorithm I first check if there's anything relevant already

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.