[Math] Formula to calculate a side of triangle with given angle

circlestriangles

enter image description here

I have triangle like in the picture.

The known angles:

  • α (total angle of the I-J-K2 triangle)
  • b (total angle of the I-P2-K2 and I-P1-K2 triangles)

The known 3D points with X,Y,Z-coordinates:

  • I
  • J
  • K1 (tangent intersection point)
  • K2 (center of the circle)

All distances between these 4 points are known (for example lenght of I-J, J-K2 or r). Also the lenght of arc from I to J is known.

P1 and P2 points are unknown. The P1 is located somewhere on the line from I to J. The P2 is somewhere on the arc of the circle.

a with 360' degrees would form a complete circle, where K2 is the center point.

What is the formula to calculate the length of X (distance between I-P1)? Or how I could calculate P1's or P2's 3D coordinates?

Best Answer

You may assume $r=1$. If you dilate or contract the image by a factor of $r$, that will simultaneously bring the radius to $r$ and scale $x$ by $r$. So we can simplify things a little by solving for $x$ with $r=1$ and then multiplying the result by $r$ for the general case.

Using the Law of Cosines, with three triangles in the figure:

$$\begin{aligned} \left(x+\overline{P_1J}\right)^2=x^2+\left(\overline{P_1J}\right)^2+2x\left(\overline{P_1J}\right) &=2(1-\cos(\alpha))\\ x^2 &=1+\left(\overline{P_1K_2}\right)^2-2\overline{P_1K_2}\cos(\beta)\\ \left(\overline{P_1J}\right)^2 &=1+\left(\overline{P_1K_2}\right)^2-2\overline{P_1K_2}\cos(\alpha-\beta)\\ \end{aligned}$$

This gives a system of equations with three unknowns: $x$, $\overline{P_1K_2}$, and $\overline{P_1J}$. You could use algebra to solve for $x$ as follows.

The second and third equations can be used to eliminate $x$ and $\overline{P_1J}$ from the first, leaving:

$$2r^2+2\left(\overline{P_1K_2}\right)^2-2r\overline{P_1K_2}\left(\cos(\beta)+\cos(\alpha-\beta)\right)\\+2\sqrt{\left(r^2+\left(\overline{P_1K_2}\right)^2-2r\overline{P_1K_2}\cos(\beta)\right)\left(r^2+\left(\overline{P_1K_2}\right)^2-2r\overline{P_1K_2}\cos(\alpha-\beta)\right)}\\=2r^2(1-\cos(\alpha))$$

After moving the terms not under the radical to the left and squaring both sides, this equation is quartic in $\overline{P_1K_2}$. That means that you could solve for $\overline{P_1K_2}$ using Cardano's quartic solution method (or maybe something simpler depending on the exact values of $r$, $\alpha$, and $\beta$.) From there, you would know $x$ using the second equation from the system above.

Related Question