Can we find incentre of a triangle by using equation of lines?
Solution 1:
Point 1: Normalise the equations. I.e. divide the first equation by $\sqrt{3^2 + 4^2} = 5$, the second equation by $\sqrt{4^2 + (-3)^2} = 5$ and the third equation by $\sqrt{18^2 + (-6)^2} = 6\sqrt{10}$. (The important bit is not really that the square of the $x$-coefficient and the square of the $y$-coefficient add up to $1$, but rather that they add up to the same thing for all three equations.)
Point 2: Now that the equations are normalised, adding any two of them gives you the bisector of that pair. Note that you might get the external bisector, in which case you need to subtract the two equations instead.
Point 3: Armed with the equations for the bisectors, you can now calculate where they intersect, which is the incenter of the original triangle.
PS: How to check that you have the correct bisector.
The bisector goes through one of the vertices of the triangle, and it's internal if the two other vertices are on either sides of the bisector, and external if the two other vertices are on the same side.
Given the equation $ax+by+c=0$ for a line, and the coordinates $(x_1,y_1)$ and $(x_2,y_2)$ of two points not on the line, checking whether the two points are in the same side of the line is done by inserting the coordinates of the points into the equation for the line. If the two numbers $ax_1+by_1+c$ and $ax_2+by_2+c$ have the same sign, then the points are on the same side of the line. If the two numbers have opposite sign, then the two points are on opposite sides of the line.
A bit faster, if you don't already have the coordinates of the vertices, is to pick a single point in the interior of the triangle, and similarly compare the sign of the two lines at that point as above. If the two lines give different signs for the same interior point, you should add the equations, otherwise you should subtract them.
Solution 2:
The intersection point (Incenter) of the internal bisectors can be obtained through a formula with the cofactors, coefficients and constants of the equations.
$A·x+B·y+C=0$
$D·x+E·y+F=0$
$G·x+H·y+I=0$
$M=\left( \begin{array}{} A & B & C \\ D & E & F \\ G & H & I \\ \end{array} \right) $
$p=\sqrt{A^2+B^2}$
$q=\sqrt{D^2+E^2}$
$r=\sqrt{G^2+H^2}$
$xI=\frac{(\frac{p·cA }{ sgn(cC)} +\frac{q· cD}{sgn(cF)}+ \frac{r ·cG}{sgn(cI)})}{p·|cC| + q· |cF| + r ·|cI|}$
$yI=\frac{(\frac{p·cB }{ sgn(cC)} +\frac{q· cE}{sgn(cH)}+ \frac{r ·cG}{sgn(cI)})}{p·|cC| + q· |cF| + r ·|cI|}$
where cA, cB, cC ... cI are the cofactors of the matrix M
calculating the Incenter with its equations
$M=\left( \begin{array}{} -3 & 8 & -6 \\ 4 & -4 & 14 \\ 18 & -6 & 7 \\ \end{array} \right)$
$CofactorsM=\left( \begin{array}{} 56 & 224 & 48 \\ -20 & 87 & 126 \\ 88 & 18 & -20 \\ \end{array} \right) $
$p=\sqrt{(-3)^2+8^2}=\sqrt{73}$
$q=\sqrt{4^2+(-4)^2}=\sqrt{32}$
$r=\sqrt{18^2+(-6)^2}=\sqrt{360}$
$xI=\frac{\frac{\sqrt{73}·56}{1}+\frac{\sqrt{32}·(-20)}{1}+\frac{\sqrt{360}·88}{-1}}{\sqrt{73}·|48|+\sqrt{32}·|126|+\sqrt{360}·|-20|}=-0.868$
$ yI=\frac{\frac{\sqrt{73}·(224)}{1}+\frac{\sqrt{32}·(87)}{1}+\frac{\sqrt{360}·(18)}{-1}}{\sqrt{73}·|48|+\sqrt{32}·|126|+\sqrt{360}·|-20|}=1.374$
alternative formula:
$xI2=\frac{\left| \left ( \begin{array}{} cA \\ cD \\ cG \end{array} \right)^T \left( \begin{array}{} \frac{p}{sgn(cC)} \\ \frac{q}{sgn(cF)} \\ \frac{r}{sgn(cI)}) \end{array} \right ) \right| }{{\left| \left ( \begin{array}{} cC \\ cF \\ cI \end{array} \right )^T \left ( \begin{array}{} \frac{p}{sgn(cC)} \\ \frac{q}{sgn(cF)} \\ \frac{r}{sgn(cI)} \end{array} \right ) \right| }}$
$yI2=\frac{\left| \left ( \begin{array}{} cB \\ cE \\ cH \end{array} \right)^T \left( \begin{array}{} \frac{p}{sgn(cC)} \\ \frac{q}{sgn(cF)} \\ \frac{r}{sgn(cI)}) \end{array} \right ) \right| }{{\left| \left ( \begin{array}{} cC \\ cF \\ cI \end{array} \right )^T \left ( \begin{array}{} \frac{p}{sgn(cC)} \\ \frac{q}{sgn(cF)} \\ \frac{r}{sgn(cI)} \end{array} \right ) \right| }}$
IncenterThreeLinesEquations