Find third point of triangle knowing two points, an angle and side length Given this situation 
Where I know points A and B, angle θ and length d, how do I find point C? I already found solutions to this problem here, but I'm a programmer and unsure how to isolate C from the proposed solutions. This is for a graphical measuring tool. I need the Cy = ? and Cx = ? equations. I suspect there will be two solutions to this, points C1 and C2, which is fine since I will pick the one closest to the mouse cursor point.
 A: Let the coordinates of A be $(A_1, A_2)$ etc.
Let's define the vectors:

*

*$X = A-B = (A_1-B_1, A_2-B_2) = (X_1, X_2)$


*$Y = A-C = (A_1-C_1, A_2-C_2) = (Y_1, Y_2)$
Now you can use the definition of dot product.
$\cos(\theta) = \frac{X_1Y_1 + X_2Y_2}{\sqrt{X_1^2 + X_2^2} \sqrt{Y_1^2 + Y_2^2}}$
Now let's use the other known parameter $d$. The length of vector $Y$ is $d$, so :
$\sqrt{Y_1^2 + Y_2^2} = d$.
This gives you two equations in two variables $C_1$ and $C_2$.
Let's simplify the first equation further:
$X_1Y_1 + X_2Y_2 = d \cos(\theta) \sqrt{X_1^2+ X_2^2}$. Note that all quantities on the right side are known. Let's call the right side $K$.
$X_1Y_1 + X_2Y_2 = K$
$(A_1-B_1)(A_1-C_1) + (A_2-B_2)(A_2-C_2) = K$
This is a linear equation in $C_1$ and $C_2$, so you can write $C_2$ as a function of $C_1$. Then plug it into $\sqrt{Y_1^2 + Y_2^2} = d$. The algebra is messy, but I think it can be solved numerically.
A: An alternative solution.
Point $C$ is the intersection of the circle centered at $A$ with radius $d$ and the line with slope $m$ through point $A$ found by considering the angle of segment $AB$ and rotating by an angle $\theta.$
