2

Here is my code:

\begin{center}
\begin{tikzpicture}

\coordinate[label=above:$A$] (A) at (2,3.464); \coordinate[label=right:$B$] (B) at (4,0); \coordinate[label=left:$C$] (C) at (0,0);

\coordinate[label=$K$] (K) at (2,1.732);

\drawultra thick--(B)--(C)--cycle;

\end{tikzpicture} \end{center}

The triangle ABC is equilateral

What I want to do is draw the three bisectors of the triangle ABC. Then I want to draw the incenter automatically based on where the bisectors intersect. Finally an automatic formula is needed to calculate the distance of the three vertices A,B,C from the incenter

2 Answers2

3

Here is a start point: I am using package tkz-euclide which is based on tikz but has its own macros making Euclid geometry easier to draw. With some changes you can make this example work not only for equilateral triangles but for every triangle. All distances and points in this example are all internally calculated by tikz based only on the initial points A and B which are defined at the beginning and the fact that the triangle ABC is equilateral.

\documentclass{standalone}
\usepackage{tkz-euclide}
\tkzSetUpPoint[size=2,color=black,fill=white]
\begin{document}

\begin{tikzpicture} \tkzDefPoints{0/0/A,6/0/B} \tkzDefPointByrotation=center A angle 60\tkzGetPoint{C} \tkzDrawPolygon(A,B,C) \tkzDefLinebisector\tkzGetPoint{c} \tkzDefLinebisector\tkzGetPoint{b} \tkzDefLinebisector\tkzGetPoint{a} \tkzDrawSegments(A,a B,b C,c) \tkzLabelSegmentabove,sloped,near start,yshift=-3pt{bisector} \tkzLabelSegmentabove left=,sloped,near end,yshift=-3pt{bisector} \tkzLabelSegmentabove left=,sloped,near start,yshift=-3pt,xshift=1cm{bisector} \tkzInterLL(A,a)(B,b)\tkzGetPoint{D} % <-- find the incenter \tkzDefPointByprojection=onto B--C\tkzGetPoint{Dbc}%<- find the projection of D on BC \tkzDefPointByprojection=onto A--C\tkzGetPoint{Dac} \tkzDefPointByprojection=onto A--B\tkzGetPoint{Dab} \tkzCalcLength(D,Dab)\tkzGetLength{dab} \tkzCalcLength(D,Dbc)\tkzGetLength{dbc}%<-- find the distance of D from BC \tkzCalcLength(D,Dac)\tkzGetLength{dac} \tkzDrawPoints(A,B,C,D,Dab,Dac,Dbc) \tkzLabelPoints(A,B,D)\tkzLabelPointabove{C} \tkzLabelSegmentabove,sloped{\tiny$\dbc cm$} \begin{scope}[xfp] \tkzMarkAnglesize=0.5,mark=| \tkzMarkAnglesize=0.5,mark=| \end{scope} \end{tikzpicture}

\end{document}

enter image description here

miltos
  • 2,605
0

Here is a variant of the Miltos code.

I used \tkzDefTriangle[equilateral]to get directly the triangle and \tkzDefTriangleCenter[in]to get the Incenter.

I removed the "scope" because it's not required here

\documentclass{standalone}
\usepackage{tkz-euclide}
\tkzSetUpPoint[size=2,color=black,fill=white]
\begin{document}

\begin{tikzpicture} \tkzDefPoints{0/0/C,4/0/B} \tkzDefTriangleequilateral \tkzGetPoint{A} %\tkzDefPointByrotation=center A angle 60\tkzGetPoint{C} \tkzDefLinebisector \tkzGetPoint{c} \tkzDefLinebisector \tkzGetPoint{b} \tkzDefLinebisector \tkzGetPoint{a} \tkzDrawSegments(A,a B,b C,c) \tkzDefTriangleCenterin \tkzGetPoint{D} % \tkzInterLL(A,a)(B,b)\tkzGetPoint{D} % <-- find the incenter \tkzDefPointByprojection=onto B--C\tkzGetPoint{Dbc}%<- find the projection of D on BC \tkzDefPointByprojection=onto A--C\tkzGetPoint{Dac} \tkzDefPointByprojection=onto A--B\tkzGetPoint{Dab} \tkzCalcLength(D,Dab)\tkzGetLength{dab} \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C,D,Dab,Dac,Dbc) \tkzLabelPoints(C,B,D) \tkzLabelPointabove{A} \tkzLabelSegmentabove,sloped{\tiny$\dab cm$} \tkzMarkAnglesize=0.5,mark=| \tkzMarkAnglesize=0.5,mark=| \tkzLabelSegmentabove,sloped,near start,yshift=-3pt{bisector} \tkzLabelSegmentabove left=,sloped,near end,yshift=-3pt{bisector} \tkzLabelSegmentabove left=,sloped,near start,yshift=-3pt,xshift=1cm{bisector} \end{tikzpicture}

\end{document}

Alain Matthes
  • 95,075