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 5964899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:30:58+00:00 2026-05-22T19:30:58+00:00

I want to calculate the rough (approximate) distance between two points to reduce the

  • 0

I want to calculate the rough (approximate) distance between two points to reduce the computation overhead.

I am using the following formula for the distance between (x1, y1) & (x2, y2):

Dist = Mod (x1 - x2) + Mod (y1 - y2)

Where Mod is the Modulus operator such that Mod(x) = |X|.

This seems to be working.

I want to know, if I have missed out something …

  • 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-22T19:30:59+00:00Added an answer on May 22, 2026 at 7:30 pm

    As long as you’re getting the absolute value (like you stated |X|) and not using the modulus function then that will give you the manhattan distance between the two points

    If that is what you want, then you’ve not missed anything

    If you want the straight line distance use the pythagorean theorem. This is sqrt((x1 – x2) ^ 2 + (y1 – y2) ^ 2)

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

Sidebar

Related Questions

I want to calculate the difference between two date/time in java using Date and
I want to calculate the average CPU usage % between two points of time.
I want to calculate the relative bearing between two geo-coordinate points. I've gone ahead
I want to calculate the angle between two vectors a and b. Lets assume
I want to calculate the difference between two times, one of which is the
I want to calculate the business days between two days on my asp.net webpage.
I want to calculate the distance between the initial value of the touchstart and
I want to calculate the number of days between two dates like start and
I want to calculate distance using 2 cellID (i am getting cell id from
I want to calculate the minimum distance between a point and a bounding box

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.