[Tex/LaTex] the easiest way to recreate the picture using tikz or tkz-euclide

diagramstikz-pgftkz-euclide

I am trying to recreate the following picture in tkz-euclide. One big question I have is if there is a way to create a triangle using only the side lengths. In other words I would like to avoid using trigonometry or any other complication to draw the triangle accurately.

enter image description here

Here is my attempt:

\begin{tikzpicture}
    \tkzDefPoint (0,0){A}
    \tkzDefPoint (3.07,0){B}
    \tkzDefPoint (1.89,1.38){C}
    \tkzDrawPolygon (A,B,C)
    \tkzInCenter(A,B,C)\tkzGetPoint{G}
    \tkzDrawPoint(G)
    \tkzDrawCircle[in](A,B,C)
\end{tikzpicture}

Best Answer

Based on Jake's answer with some refinements

\documentclass[border=5mm]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}

    \pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt}  

    \pgfdeclaredecoration{add dim}{final}{
    \state{final}{% 
    \pgfmathsetmacro{\dist}{\pgfkeysvalueof{/pgf/decoration/distance}}
              \pgfpathmoveto{\pgfpoint{0pt}{0pt}}             
              \pgfpathlineto{\pgfpoint{0pt}{2*\dist}}   
              \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} 
              \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{2*\dist}}     
              \pgfsetarrowsstart{latex}
              \pgfsetarrowsend{latex}
              \pgfpathmoveto{\pgfpoint{0pt}{\dist}}
              \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} 
              \pgfusepath{stroke} 
              \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
              \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
    }}

    \tikzset{
        dim/.style args={#1,#2,#3}{%
                    decoration = {add dim,distance=\ifx&#2&0pt\else#2\fi},
                    decorate,
                    postaction = {%
                       decorate,
                       decoration={%
                            raise=\ifx&#2&0pt\else#2\fi,
                            markings,
                            mark=at position .5 with {\node[inner sep=0pt,
                                                            font=\footnotesize,
                                                            fill=\ifx&#1&none\else white\fi,
                                                            #3] at (0,0) {#1};}
                       }
                    }
        },
        dim/.default={,0pt,}
    }       
\begin{tikzpicture}[scale=2]
\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
% Define the first two points
\tkzDefPoint(0,0){A}
\tkzDefPoint(3.07,0){B}

% Find the intersections of the circles around A and B with the given radii
\tkzInterCC[R](A,2.37cm)(B,1.82cm)
\tkzGetPoints{C}{C'}

% Draw the interior circle
\tkzDrawCircle[in](A,B,C) \tkzGetPoint{G}
\tkzGetLength{rIn} 

% Reset the bounding box so we don't get empty space around our triangle
\pgfresetboundingbox

% Draw the triangle and the points
\tkzDrawPolygon(A,B,C)
\tkzDrawPoints(A,B,C)

% Label the sides
\tkzCalcLength[cm](A,B)\tkzGetLength{ABl}
\tkzCalcLength[cm](B,C)\tkzGetLength{BCl}
\tkzCalcLength[cm](A,C)\tkzGetLength{ACl}

% add dim
\tkzDrawSegment[dim={\pgfmathprintnumber\BCl,6pt,transform shape}](C,B)
\tkzDrawSegment[dim={\pgfmathprintnumber\ACl,6pt,transform shape}](A,C)
\tkzDrawSegment[dim={\pgfmathprintnumber\ABl,-6pt,transform shape}](A,B)

% Labels 
\tkzLabelPoints(A,B) \tkzLabelPoints[above](C)
\tkzDefShiftPoint[G](70:\rIn pt){g}  
\tkzDefShiftPoint[g](70: .5 cm){gg} \tkzDefShiftPoint[gg](0: .5 cm){ggg}  
\tkzDrawSegment[->](G,g) \tkzDrawSegment(g,gg) 
\tkzDrawLine[add=0 and 0,end={$r=?$}](gg,ggg) 
\end{tikzpicture}
\end{document}

enter image description here

Related Question