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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:47:56+00:00 2026-06-11T13:47:56+00:00

i want to calculate how many pixels there are between 2 points on my

  • 0

i want to calculate how many pixels there are between 2 points on my screen.

I’ve seen that i can draw a straight line between 2 points using Path class, but i don’t really want to draw that line, i only want to know how long is it in pixels..

i really need it for my MapView clusters implementation..

i can get each marker position on screen with no problem, but don’t know how to calculate pixel’s “distance” between them …
i know that there are cluster’s implementations available but i want to try and create one of my own

help will be appreciated 🙂

  • 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-06-11T13:47:57+00:00Added an answer on June 11, 2026 at 1:47 pm

    This is very straightforward using a bit of algebra 🙂

    Take the co-ordinates of both points and calculate the difference between their x and y values e.g.

    dx = p1.x - p2.x;
    dy = p1.y - p2.y;
    
    distance = Math.sqrt( (dx * dx) + (dy * dy) );
    

    Where p1 and p2 are the points you want get find the distance between, and distance is the result. It will be a double but you can round it to the nearest int if you wish

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

Sidebar

Related Questions

I have a dropdownlist in ASP.NET Webforms that I want to calculate how many
I want to generate checkbox field using GridView and system will calculate how many
I want to calculate distance in my custom repository class. The problem is that
I want to calculate the smallest integer with exactly k bits set, that is
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've dictionary which contains values like this {a:3,b:9,c:88,d:3} I want to calculate how many
So, I am trying to calculate the time between two dates that fits certain
I'm doing a simulation where I must calculate many averages and I thought that
I have a GIT repository and I want to calculate how many lines of

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.