Find 3rd point of triangle knowing A and B coordinates and all the angles

166 Views Asked by At

I got a triangle, knowing A and B coordinates and all the three angles, how can I calculate C coordinates?

enter image description here Schema

2

There are 2 best solutions below

1
On BEST ANSWER

I finally find a post that understandable for the noob that I am ^^

Answering post

x1=0;y1=0;x2=6;y2=0; % initial data

alp1=2*pi/3;alp2=pi/6; % initial data

u=x2-x1;v=y2-y1;a3=sqrt(u^2+v^2);

alp3=pi-alp1-alp2;

a2=a3*sin(alp2)/sin(alp3);

RHS1=x1*u+y1*v+a2*a3*cos(alp1);

RHS2=y2*u-x2*v+a2*a3*sin(alp1);

x3=(1/a3^2)(uRHS1-v*RHS2);

y3=(1/a3^2)(vRHS1+u*RHS2);

0
On

Let \begin{align*} R_\alpha:=\begin{pmatrix}\cos\alpha & -\sin\alpha\\\sin\alpha &\cos\alpha\end{pmatrix} \end{align*} be the rotation matrix which rotates a vector around the origin in anti-clockwise direction by the angle $\alpha$ (given in rad).

Let $\alpha$ be the angle $CAB$ at $A$, and let $\beta$ be the angle $ABC$ at $B$. Now, $C$ is the intersection of the line from $A$ to $B$ rotated by $-\alpha$ and of the line from $B$ to $A$ rotated by $\beta$. Thus, $C$ satisfies the system of 4 linear equations: \begin{align} C&=A+xR_{-\alpha}(B-A), &(1) \\ C&=B+yR_\beta(A-B). &(2) \end{align} These equations are equivalent to the system of 2 linear equations \begin{align*} &(I-xR_{-\alpha}-yR_\beta)(A-B)=0. &(3) \end{align*} Now, just solve these two equations for $x$ or $y$ (it doesn't matter) and then put this in (1) or (2) to get $C$.

Example: Let $A=(1,4),B=(2,1),\alpha=1.5,\beta=0.5.$ Then $(A-B)=(-1,3)$ and $(3)$ reads \begin{align*} -2.92175 x+2.31586 y&=1, \\ -1.20971 x-2.15332 y&=-3. \end{align*} The solution is $x=0.527248, y=1.097$, which gives $C=(-0.540487,3.36218)$. enter image description here