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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:17:51+00:00 2026-06-01T19:17:51+00:00

I have two sets of pixel coordinates that represent a bounding box: top left:

  • 0

I have two sets of pixel coordinates that represent a bounding box:

top left: 
x: 19757934
y: 25240264

bottom right: 
x: 19759195
y: 25240776

I need to convert another point’s coordinates, that are on a different number range into the above range, maintaining the original ratio (to find out where this point is located within the bounding box).

x: 423
y: 142
  • 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-01T19:17:53+00:00Added an answer on June 1, 2026 at 7:17 pm

    Suppose there is a box the user clicks on, which does something to a “result” box somewhere else, like a scaled down box.

    var from_coords = {x1:50,y1:80,x2:150,y2:180};
    var to_coords = {x1:200,y1:230,x2:400,y2:430};
    function translate(input_coords) { // input_coords = {x:123,y:123}
        return {
            x:to_coords.x1+(input_coords.x-from_coords.x1)*(to_coords.x2-to_coords.x1)/(from_coords.x2-from_coords.x1),
            y:to_coords.y1+(input_coords.y-from_coords.y1)*(to_coords.y2-to_coords.y1)/(from_coords.y2-from_coords.y1)
        };
    }
    
    console.log(translate({x:123,y:123}); // outputs {x:346,y:316}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two separate sets of tables in the same database that model the
I have a class that contains two sets. They both contain the same key
I have a program that compares variables from two structs and sets a bit
I have two sets of table that are identical. One for sales and one
I have two sets of lists that are synchronized and look like this: (by
I have two sets of items, one that I have my jQuery treating the
I have two sets of data points that both relate to the same primary
I have two sets of information. One is a date that is in Tuesday,
Suppose that I have two sets of associated types, for example Animal s and
For simplicity, let's say that I have two sets of words, sorted into alphabetical

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.