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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:38:50+00:00 2026-05-16T17:38:50+00:00

Sorry if this doesn’t make sense… I know the length of the triangle segments

  • 0

Sorry if this doesn’t make sense… I know the length of the triangle segments and the xy coordinates of two points. How do I figure out the xy of the 3rd point?

  • 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-16T17:38:51+00:00Added an answer on May 16, 2026 at 5:38 pm

    Given the following picture (see: http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/):

    alt text

    here’s a Java demo where I used the following variable names:

     picture above | Java code
    ---------------+----------------
     P0            | p1
     P1            | p2
     P2            | temp
     P3            | p3
     a             | a
     (a+b)         | d
     h             | h
     r0            | distanceFromP1
     r1            | distanceFromP2
    

    public class Main {
    
        public static Point[] getP3(Point p1, double distanceFromP1, Point p2, double distanceFromP2) {
            double d = p1.distance(p2);
    
            if(d > (distanceFromP1 + distanceFromP2) || p1.equals(p2) || d < Math.abs(distanceFromP1 - distanceFromP2)) {
                // there does not exist a 3rd point, or there are an infinite amount of them
                return new Point[]{};
            }
    
            double a = (distanceFromP1*distanceFromP1 - distanceFromP2*distanceFromP2 + d*d) / (2*d);
            double h = Math.sqrt(distanceFromP1*distanceFromP1 - a*a);
    
            Point temp = new Point(p1.x + a*(p2.x - p1.x) / d, p1.y + a*(p2.y - p1.y) / d);
    
            return new Point[]{
                    new Point(temp.x + h * (p2.y - p1.y) / d, temp.y - h * (p2.x - p1.x) / d),
                    new Point(temp.x - h * (p2.y - p1.y) / d, temp.y + h * (p2.x - p1.x) / d)
            };
        }
    
        public static void main(String[]args) throws Exception {
            Point a = new Point(1,1);
            Point b = new Point(5,4);
            Point c = new Point(0,0);
            Point d = new Point(2,0);
            System.out.println("test 1 :: "+Arrays.toString(getP3(a, 4, b, 3)));       // 2 distinct 3rd points
            System.out.println("test 2 :: "+Arrays.toString(getP3(c, 1, d, 1)));       // 1 distinct 3rd point
            System.out.println("test 3 :: "+Arrays.toString(getP3(c, 0.99999, d, 1))); // none
            System.out.println("test 4 :: "+Arrays.toString(getP3(d, 1, d, 1)));       // infinite
            System.out.println("test 5 :: "+Arrays.toString(getP3(c, 50, d, 1)));      // none, one circle "contains" the other
        }
    }
    
    class Point {
    
        final double x;
        final double y;
        private final int hash;
    
        public Point(double x, double y) {
            this.x = x;
            this.y = y;
            this.hash = Double.valueOf(x).hashCode() ^ Double.valueOf(y).hashCode();
        }
    
        public double distance(Point that) {
            double dX = this.x - that.x;
            double dY = this.y - that.y;
            return Math.sqrt(dX*dX + dY*dY);
        }
    
        @Override
        public boolean equals(Object o) {
            if(o == null || getClass() != o.getClass()) return false;
            Point that = (Point)o;
            return this.x == that.x && this.y == that.y;
        }
    
        @Override
        public int hashCode() {
            return  hash;
        }
    
        @Override
        public String toString() {
            return String.format("(x=%f, y=%f)", x, y);
        }
    }
    

    Which will produce the following output:

    test 1 :: [(x=5.000000, y=1.000000), (x=2.120000, y=4.840000)]
    test 2 :: [(x=1.000000, y=0.000000), (x=1.000000, y=0.000000)]
    test 3 :: []
    test 4 :: []
    test 5 :: []
    

    Note that the above is just a simple demo. Be careful with the floating point comparisons!

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

Sidebar

Related Questions

Sorry if this question doesn't make any sense. I'm currently in the midst of
Sorry if this doesn't make any sence, but I'm trying my best to understand
I'm sorry if this title doesn't describe the problem properly but I wasn't sure
I'm sorry to have to bring up this as well. But it doesn't seem
sorry this is such a simple question but I can't figure it out. How
First of all, I am sorry if this question doesn't belong to SO since
I've been at this for an hour or two, but can't seem to figure
I'm sorry if this is an absolute noob question, but I can't figure this
Can somebody please explain to me why this doesn't work? I'm sorry I'm a
I'm sorry, but I can't understand why this doesn't work. After compile, I receive

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.