Need help to solve a geometry problem

shan86

New member
Joined
Sep 10, 2021
Messages
7
Untitled-1.jpg
In above diagram X, Y and R are given. I need to find a and b angles. Please let me know how to do that. Thanks
 
If the angle between side x and side y is a right angle, you could use Pythagoras' theorem to find the length of the other dotted line. Then use some basic trig to find angle b.
 
 
We need to know is the line marked x parallel to the line with the arrow at the bottom, and is the line marked y perpendicular to the line marked x.
 
If the angle between side x and side y is a right angle, you could use Pythagoras' theorem to find the length of the other dotted line. Then use some basic trig to find angle b.
Hi, thanks for the reply. Yes, x and y is a right angle. And I can find the length of the hypotenuse. But then, I don't know how to find those angles. Please help me
 
We need to know is the line marked x parallel to the line with the arrow at the bottom, and is the line marked y perpendicular to the line marked x.
Hi, thanks for the reply. Yes, x is parallel to the arrow at the bottom. And x and y forms a right angle. Please let me know how to find those angles.
 
Ok, sorry I missed that. I'm a software developer and I need to work on a project that involves 2D shapes. This is stripped down version of the problem that I'm facing right now. Basically, I need to draw this shape, based on the X, Y and R, which are user inputs.
 
Basically you need to find the co-ordinates of the corner of the shape (at the right angle).
Altering your notation slightly:
1631377990370.png
you simply need to solve the simultaneous quadratic equations in x and y:
1. [imath](x+u)^2+y^2=r^2[/imath]
2. [imath]x^2+(y+v)^2=r^2[/imath]

This yields a solution [imath]x=\dfrac{-u+\sqrt{u^2-4\alpha}}{2}, y=\sqrt{r^2-(x+u)^2}[/imath]
where [imath]\alpha=\dfrac{u^2+v^2}{4}-\dfrac{v^2r^2}{u^2+v^2}[/imath]

(Depending on whether u and/or v are less than r, there may be a corresponding solution in each of the 4 quadrants, in 2 quadrants, in only 1 quadrant or no solution if u, v are 'too large' relative to r).
 
If you need to find the angles rather than coordinates, I would do this:

1631380258835.png

Using the right triangle with legs x and y, find the diagonal, and also find the angle marked in red. This is congruent to the red angle at the origin, because the sides of the angles are perpendicular.

Then using the right triangle with the red line as a leg, find the angle marked in blue. From those two angles, you can find a and b.
 
  • Like
Reactions: lex
Basically you need to find the co-ordinates of the corner of the shape (at the right angle).
Altering your notation slightly:
View attachment 28857
you simply need to solve the simultaneous quadratic equations in x and y:
1. [imath](x+u)^2+y^2=r^2[/imath]
2. [imath]x^2+(y+v)^2=r^2[/imath]

This yields a solution [imath]x=\dfrac{-u+\sqrt{u^2-4\alpha}}{2}, y=\sqrt{r^2-(x+u)^2}[/imath]
where [imath]\alpha=\dfrac{u^2+v^2}{4}-\dfrac{v^2r^2}{u^2+v^2}[/imath]

(Depending on whether u and/or v are less than r, there may be a corresponding solution in each of the 4 quadrants, in 2 quadrants, in only 1 quadrant or no solution if u, v are 'too large' relative to r).
Thanks @lex, for the detailed explanation. This helps a lot.
 
If you need to find the angles rather than coordinates, I would do this:

View attachment 28858

Using the right triangle with legs x and y, find the diagonal, and also find the angle marked in red. This is congruent to the red angle at the origin, because the sides of the angles are perpendicular.

Then using the right triangle with the red line as a leg, find the angle marked in blue. From those two angles, you can find a and b.
Thanks @Dr. Peterson, Your solution is the easiest. I think I can go with this. I'll update the result. Thanks again.
 
If anyone interested, this is how I implemented it in c/c++. Thanks everyone.

C:
double l = ::sqrt(x*x + y*y) / 2.0;
double a1 = ::atan2(x, y);
double a2 = ::asin(l / r);
double a3 = a1 - a2;

_ASSERT(a1 > a2);

double b = a2 * 2;
double a = a1 - a2;
 
Top