2

I would like to have a formula to calculate the $x,y$ coordinates of a point "$B_2$" on the hypotenuse of a right triangle, given the angles "$b$" and "$a$" or the length of line $A-B_2$: see the triangle diagram here.

enter image description here

From this similar question, I have been able to calculate this point when the opposite and adjacent legs are equal, by using the formula $$ x = \frac{\sin(a)}{ \dfrac{\sin(135-a) }{ y}}=\frac{y\sin(a)}{ \sin(135-a) } $$

However, I also want to find this point when both "$a$" and "$b$" angles vary in the range of $0°$ to $90°$, and I have not been able to figure out how to change this formula to accommodate two varying angles.

Please help!

Edit: The main goal is to be able to use the coordinates of B2 to locate geometry, i.e. drawing a line from C to B2, or a polygon or ellipse centered at B2, and the way I want to control where B2 is located on the hypotenuse is by changing angles b, and a. If I have to calculate the location of point B2 by locating it at a distance x from A with sin/cos, that’s okay also.

Paul
  • 23
  • Is it safe to assume that the coordinates of vertices are given? – Vasili Aug 19 '19 at 00:50
  • Yes... coordinates for A, B, C are fully defined. I'm working in Processing which is a Java based language. I'm not sure how helpful it would be to include any code, but I could. – Paul Aug 19 '19 at 00:56

3 Answers3

0

$$ \angle CAB_2 = 90 - b$$

$$ \angle AB_2 C = 180 - a - ( 90 - b) = 90 - (b-a)$$

We can use sine law to find $x \equiv |A B_2| $ given $a,b$ and $y \equiv |AC|$

$$ x =y \frac {\sin(a) }{\sin(90-(b-a))} =y \frac {\sin(a) }{\cos(b-a)} $$

WW1
  • 10,497
0

I am assuming that your objective is to compute the length of $AB_2$

Let me call it $x$ and also let $\angle ACB_2 = \alpha$

In trigonometry, it is a standard convention to denote the side $AC$ by $b$, the side $BC$ by $a$ and the side $AB$ by $c$

Now by the Law of Sines, we can write

$\displaystyle \frac{x}{\sin \alpha} = \frac{b}{\sin (\pi - A - \alpha)} = \frac{b}{\sin (A + \alpha)} = \frac{CB_2}{\sin A}$

or, $\displaystyle x = \frac{b \sin \alpha}{\sin (A + \alpha)} = \frac{CB_2 \sin \alpha}{\sin A}$

Does it solve your problem? Please let me know.

PTDS
  • 3,464
  • This formula does work the way I hoped it would, thank you very much. One thing I don’t like is that when I set the value of the angle ACB2, it is being drawn as though I were saying draw the line with the angle BCB2. So when I try for a line 10deg CW from AC, instead it draws 10deg CCW from BC. But B2 stays right on the hypotenuse no matter how I change angles b and a as labeled in my diagram which is the main problem I was trying to solve. – Paul Aug 20 '19 at 11:38
0

If the coordinates of $\text{A}$ and $\text{B}$ are $\ x_A, y_A\ $ and $\ x_B, y_B\ $ respectively, then those of $\text{B2}$ will be $\ \frac{x_A\cot b + x_B\tan a }{\cot b+ \tan a}, \frac{y_A\cot b + y_B\tan a }{\cot b+ \tan a}\ $.

To see this, drop a perpendicular from $\text{B2}$ to $\text{BC}$ to intersect it at $\text{D}$. Then $\ \lvert \text{BD}\rvert=\lvert \text{B2D}\rvert\cot b\ $, $\ \lvert \text{CD}\rvert=\lvert \text{B2D}\rvert\cot\left(\frac{\pi}{2}-a\right)=\lvert \text{B2D}\rvert\tan a\ $, so from the similarity of triangles $\text{B2BD}$ and $\text{ABC}$, we get $\ \frac{\lvert \text{BD}\rvert}{\lvert \text{BC}\rvert}=\frac{\cot b }{\cot b+ \tan a}=\frac{\lvert \text{BB2}\rvert}{\lvert \text{BA}\rvert}=\frac{x_B-x}{x_B-x_A}=\frac{y_B-y}{y_B-y_A}\ $, where $\ x,y\ $ are the coordinates of $\text{B2}$. The expressions given above for $\ x\ $ and $\ y\ $ therefore follow.

enter image description here

lonza leggiera
  • 28,646
  • 2
  • 12
  • 33
  • I’ve had a little trouble getting this to work properly, when I set the angle a to 45deg, it puts B2 somewhere a bit CCW from that. It could be that I have to use a function called atan() because my programming language doesn’t have cot(), or maybe I’m using parenthesis wrong. But I will keep trying and see if I can get it to work. – Paul Aug 20 '19 at 11:43
  • Don't use $\ \text{atan}\ $. It will almost certainly return the arctangent of its argument, and that's a completely different function from $\ \cot\ $. – lonza leggiera Aug 20 '19 at 12:29
  • Unfortunately there was a typo in the expression I gave for the $\ x$-coordinate of $\text{B2}$, which I've now corrected. You don't need a separately pre-specified function for $\ \cot\ $. If you multiply the numerators and denominators of the expressions I've given for the coordinates of $\text{B2}$ through by $\ \tan b\ $, you get the equivalent expressions $\ \frac{x_A + x_B\tan a\tan b}{1+\tan a\tan b},\frac{y_A + y_B\tan a\tan b}{1 +\tan a\tan b}\ $. – lonza leggiera Aug 20 '19 at 13:12
  • Now this is working perfectly, thank you for the updated answer, and for the solution to this problem. – Paul Aug 20 '19 at 21:50