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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:39:32+00:00 2026-05-15T05:39:32+00:00

please refer to my quick diagram attached below. what i’m trying to do is

  • 0

please refer to my quick diagram attached below.

what i’m trying to do is get the coordinates of the yellow dots by using the angle from the red dots’ known coordinates. assuming each yellow dot is about 20 pixels away from the x:50/y:250 red dot at a right angle (i think that’s what it’s called) how do i get their coordinates?

i believe this is very basic trigonometry and i should use Math.tan(), but they didn’t teach us much math in art school.

alt text http://www.freeimagehosting.net/uploads/e8c848a357.jpg

  • 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-15T05:39:33+00:00Added an answer on May 15, 2026 at 5:39 am

    You don’t actually need trigs for this one. Simply use slopes, or change in x and y.

    Given a line of slope m = y/x, the line perpendicular to that line has slope -1/m, or -x/y.

    The slope m between the red dots is -150/150, or -1/1. I noticed your positive y points down.

    Therefore, the positive slope is 1/1. Both of your x and y changes at the same speed, with the same amount.

    Once you know that, then it should be pretty easy to figure out the rest. Since they’re aligned at 45 degrees angle, the edge ratio of the 45-45-90 triangle is 1 : 1 : sqrt(2). So if your length is 20, the individual x and y change would be 20/sqrt(2), or roughly 14 in integers.

    So, your two yellow dots would be at (36, 236), and (64, 264). If the lines are not aligned to a convenient degree, you would have to use arctan() or something similar, and get the angle between the line and the horizontal line, so you can figure out the ratio of x and y change.

    I hope my answer wasn’t too hard to follow. For a more general solution, see Troubadour’s answer.


    Edit: Since the OP said the lower red dot is actually rotating around the upper red dot, we will need a more flexible solution instead.

    I’m going to extend this answer from Troubadour’s, since I’m doing exactly the same thing. Please refer to his post as you read mine.

    1.
    Get the vector from origin (200, 100) to rotating point (50, 250):

    vector = (200 - 50, 100 - 250) = (150, -150)
    

    2.
    Rotate your vector by swapping the x and y, and negate x to get the new vector:

    vector = (150, -150) => swap => (-150, 150) => negate x => (150, 150)
    

    3.
    Get the unit vector (of length 1) from the new vector:

    vector = vector / length(vector)
           = (150 / length(vector), 150 / length(vector))
           ~= (0.7071, 0.7071)
    
           where
    
           length(vector) = sqrt(150^2 + 150^2) ~= 212.2320
    

    4.
    Get the displacement vector of length 20, by multiplying the unit vector.

    displacement_vector = vector * 20 
                        = (0.7071 * 20, 0.7071 * 20)
                        = (14.1421, 14.1421)
    

    5.
    Add/Subtract this vector to/from your rotating vector (point):

    yellow_1 = (50, 250) + (14.1421, 14.1421) ~= (64, 254)
    yellow_2 = (50, 250) - (14.1421, 14.1421) ~= (36, 236)
    

    I hope the above steps help you with formulating your code. Doesn’t matter what the angle it’s at, same steps.

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

Sidebar

Related Questions

Please refer to this: http://jsfiddle.net/k8c7w/ I am trying to get the middle grey band
I'm trying to design a horizontal menu just using CSS Please refer to the
Please refer to Get PDF hyperlinks on iOS with Quartz It explained an algorithm
How to build exe files from py files (compatible with win32)? please don't refer
Please refer to the code below, when I comment in either of the commented
Please refer to the Java code below: class Base{ Base(){ System.out.println(Base Constructor); method(); }
Please refer to http://jsfiddle.net/7FfMd/6/ run the code, then select E from the drop down,
Please refer to the below code Specialized function in non specialized Template class Is
Please refer to the below jsfiddle code snippet: http://jsfiddle.net/JLXs5/3/ When the user clicks here,
please refer to the code below. $dArr = '<script>document.write(volunteerDist);</script>'; $dArr gets the value 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.