TITLE: How do you find the equation for the angle bisecting line given three coordinates that make up an angle?
QUESTION [5 upvotes]: I have three points,$$A =[A_x,A_y]\,,\, B =[B_x,B_y]\,,\,C =[C_x,C_y]$$ 
How could one calculate the equation for the line that bisects the angle $\,\angle ABC\,$ (eg., passing through $B$)?

REPLY [4 votes]: Start with a translation -- i.e., shift things to a slightly modified coordinate system so that $B$ is the origin $(0, 0)$:
$$ A \mapsto \left[A_x-B_x, A_y-B_y\right]  = A'\\
B \mapsto \left[B_x-B_x, B_y-B_y\right] = B'\\
C \mapsto \left[C_x-B_x, C_y-B_y\right] = C'$$
Compute the angles formed by $A'$ and $C'$ with respect to the positive $x$ axis:
$$\theta_A = \tan^{-1} \frac{A_y-B_y}{A_x-B_x}$$
$$\theta_C = \tan^{-1} \frac{C_y-B_y}{C_x-B_x}$$
Compute the angle between $A'$ and $C'$:
$$\theta = \cos^{-1} \left( \frac{A'\cdot C'}{\|A'\|\|C'\|} \right)$$
Divide by two, and add this angle to the smaller of $\theta_A$ and $\theta_C$:
$$\phi = \min \left\{ \theta_A, \theta_C\right\}+\frac{\theta}{2}$$
Find a unit vector that has this angle in the shifted coordinate system, i.e.
$$\begin{align*}
\tan \phi &= \frac{D_y}{D_x} \\
D_x^2+D_y^2 &= 1
\end{align*}$$
Alternatively, ignore the fact that it must be a unit vector, and just set $D_x = 1$ and compute $D_y$--it will still be on the same line, no matter what.
Finally, shift things back to original coordinates:
$$D = \left[ D_x + B_x, D_y + B_y \right].$$

Example:
$$A = [3,3] \\ B = [2,2] \\ C = [1,3]$$
Then,
$$A' = [3-2,3-2] = [1,1] \\ C' = [1-2,3-2] = [-1,1],$$
$$ \theta = \cos^{-1} \frac{ 1\cdot (-1)+1\cdot 1}{\sqrt{1^2+1^2}\sqrt{(-1)^2+1^2}} = \cos^{-1} 0 = \pi/2\ \;\;\; (\text{90 degrees}),$$
$$ \theta_A = \tan^{-1} 1 = \pi/4\ \;\;\; (\text{45 degrees})$$
$$ \theta_C = \tan^{-1} -1 = 3\pi/4\ \;\;\; (\text{135 degrees})$$
The smaller of $\theta_A$, $\theta_C$ is $\theta_A$, so finally,
$\phi = \frac{\pi}{4}+\frac{1}{2}\theta = \frac{\pi}{4}+\frac{\pi}{4} = \frac{\pi}{2}$
as expected.
If $\phi = \pi/2$, then this is a vector pointing along the y-axis, so let $D' = (0,1)$, which leads to $D = D'+B = (0+2,1+2) = (2,3).$
Plot $A$, $B$, $C$ and D$ and you will see that this is the desired result.