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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:56:02+00:00 2026-06-14T21:56:02+00:00

I have a triangle ABC inscribed in a circle. Point B is located in

  • 0

I have a triangle ABC inscribed in a circle. Point B is located in the centre of the circle, A and C are two points on the circle.

circle with inscribed triangle

Given

Given AB (length)

Given coords of A and B

Given angle B (angle ABC)

Needed

Find coords of C

What I know

AB = BC, both are radius’s

What I am using this for

I am making a basic 3D java game, for android. This will be used for looking left and right, so if you click on the right part of the screen the objects will move around you by adding one degree to angle B.

The code I tried for finding coords of C

rect.get(index)[5] = (int) ((di * Math.cos(Math.toRadians(angle-90)))+.5);
rect.get(index)[6] = (int) ((di * Math.sin(Math.toRadians(angle-90)))+.5);
rect.get(index)[5] = shapes x coord 
rect.get(index)[6] = shapes y coord 

di = radius length 
angle = angle B

and I added the .5 so that when the coord is truncated it is rounded.

My complete code

    double di = distance(playerx, playery, rect.get(index)[5], rect.get(index)[6]);
    double side1 = di;
    System.out.println("Side1: "+ side1);
    double side2 = side1;
    System.out.println("Side2: "+ side2);
    double side3 = distance(rect.get(index)[5], rect.get(index)[6], playerx, playery+di);
    System.out.println("Side3: "+ side3);

    double angle = ((side1*side1)+(side2*side2)-(side3*side3));
    angle = angle/(2*side1*side2);
    angle = Math.acos(angle)*(180/Math.PI);
    System.out.println("Angle: "+angle);
    if(playerx > rect.get(index)[5]){
        if(lookdirection.equals("left")){
            angle += 5;
        }
        if(lookdirection.equals("right")){
            angle -= 5;
        }
    }
    else{
        if(lookdirection.equals("left")){
            angle -= 5;
        }
        if(lookdirection.equals("right")){
            angle += 5;
        }
    }
    System.out.println("Angle: "+angle);

    rect.get(index)[5] = -(di * Math.cos(Math.toRadians(angle-90)));
    rect.get(index)[6] = -(di * Math.sin(Math.toRadians(angle-90)));

    di = distance(playerx, playery, rect.get(index)[5], rect.get(index)[6]);
    side1 = di;
    System.out.println("Side1: "+ side1);
    side2 = side1;
    System.out.println("Side2: "+ side2);
    side3 = distance(rect.get(index)[5], rect.get(index)[6], playerx, playery+di);
    System.out.println("Side3: "+ side3);
    angle = ((side1*side1)+(side2*side2)-(side3*side3));
    angle = angle/(2*side1*side2);
    angle = Math.acos(angle)*(180/Math.PI);
    System.out.println("Angle: "+angle);

    repaint();
}

The angles are now working but the X and Y coords
but

    rect.get(index)[5] = -(di * Math.cos(Math.toRadians(angle-90)));
rect.get(index)[6] = -(di * Math.sin(Math.toRadians(angle-90)));

are getting very large/ small values. They should stay ‘di’ distance away from point B.

  • 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-14T21:56:03+00:00Added an answer on June 14, 2026 at 9:56 pm

    UPDATED

    It seems that this is a geometry problem!
    I haven’t tested your code but I guess what you want is not

    rect.get(index)[6] = (int) ((di * Math.sin(Math.toRadians(angle-90)))+.5);
    

    but

    rect.get(index)[6] = (int) (-(di * Math.sin(Math.toRadians(angle-90)))+.5);
    

    Try to visualise what you are doing and check the identities under symmetry, shifts, and periodicity here. The image is turning and reflecting along the x axis with what you are doing now. You have to take care of rounding issues as well. If coordinates are close to 0 the image might not move.

    My suggestion is to keep your coordinates as doubles and only round them when you are going to render them into a pixel without overwriting their value

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

Sidebar

Related Questions

I have two lists like: list1 = ['square','circle','triangle'] list2 = ['red','green'] How can I
I have 3 points ( lat , lon ) that form a triangle.How can
I have: <div class=ui-widget> <div class=ui-widget-header> <span class=ui-icon ui-icon-circle-triangle-n>My Menu</span> </div> <ul class=ui-widget-content> <li>Menu
I have: <div class=ui-widget> <div class=ui-widget-header> My Menu<span class=ui-icon ui-icon-circle-triangle-n></span> </div> <ul class=ui-widget-content> <li>Menu
I have to programming a triangle-calculator, that can calculate from three given values all
I have written a function for returning the next row in Pascal's triangle given
Say I have a square from (0,0) to (z,z). Given a triangle within this
I have this problem : 3 points A, B, C that make an angle
Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2)
I would like to have a little triangle underneath the the text that points

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.