[Tex/LaTex] Add sloped labels in tikz

tikz-pgf

I have the following drawn in Tikz.

enter image description here

using the following code

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\coordinate[label= above left:$O$] (O) at (0,0);
\draw (O) circle (3);
\coordinate[label = below left:$P$] (P) at (-90:3);
\coordinate (Q) at (-25:3);
\node at ([shift = {(-30:3.3)}]O.-35) {$Q$};
\draw (O)-- (P)-- (Q) -- cycle;
\coordinate[label = right:$R$] (R) at (6.5,-3);
\draw (R)--(P)--(Q)--cycle;
\draw (O) -- ($(P)!(O)!(Q)$) node[draw,pos=1,sloped, anchor = north east]{}node[pos=1.08]{$T$};
\end{tikzpicture}
\end{document}

I now want to add a sloped label above line QR that says "24 cm" and also one for line OT as "12 cm".

I want something like this

enter image description here

EDIT: I managed to get the sloped label, but how can I get arrows such as in the (badly hand drawn) image?

I used the following for the text

\draw (Q) -- (R) node[sloped, anchor = south east, pos =0.5]{$24 cm$};

How can I do this?

Best Answer

Without braces:

\documentclass{article}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\coordinate[label= above left:$O$] (O) at (0,0);
\draw (O) circle (3);
\coordinate[label = below left:$P$] (P) at (-90:3);
\coordinate (Q) at (-25:3);
\node at ([shift = {(-30:3.3)}]O.-35) {$Q$};
\draw (O)-- (P)-- (Q) -- cycle;
\coordinate[label = right:$R$] (R) at (6.5,-3);
\draw (R)--(P)--(Q)-- node[above,sloped] {\SI{24}{\cm}}cycle;
\draw (O) -- ($(P)!(O)!(Q)$) node[draw,pos=1,sloped, anchor = north east]{}node[pos=1.08]{$T$} node[midway,above,sloped] {\SI{12}{\cm}};
\end{tikzpicture}
\end{document}

enter image description here

With braces:

\documentclass{article}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{tkz-euclide}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\coordinate[label= above left:$O$] (O) at (0,0);
\draw (O) circle (3);
\coordinate[label = below left:$P$] (P) at (-90:3);
\coordinate (Q) at (-25:3);
\node at ([shift = {(-30:3.3)}]O.-35) {$Q$};
\draw (O)-- (P)-- (Q) -- cycle;
\coordinate[label = right:$R$] (R) at (6.5,-3);
\draw (R)--(P)--(Q)-- cycle;
\draw (O) -- ($(P)!(O)!(Q)$) coordinate (T) node[draw,pos=1,sloped, anchor = north east]{}node[pos=1.08]{$T$};
\draw[decorate,decoration={brace,raise=3pt}]
  (Q)  -- node[above=6pt,sloped] {\SI{24}{\cm}} (R);
\draw[decorate,decoration={brace,raise=3pt}]
  (O)  -- node[above=6pt,sloped] {\SI{12}{\cm}} (T);
\end{tikzpicture}
\end{document}

enter image description here

With dimension arrows:

\documentclass{article}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\coordinate[label= above left:$O$] (O) at (0,0);
\draw (O) circle (3);
\coordinate[label = below left:$P$] (P) at (-90:3);
\coordinate (Q) at (-25:3);
\node at ([shift = {(-30:3.3)}]O.-35) {$Q$};
\draw (O)-- (P)-- (Q) -- cycle;
\coordinate[label = right:$R$] (R) at (6.5,-3);
\draw (R)--(P)--(Q)-- cycle;
\draw (O) -- ($(P)!(O)!(Q)$) coordinate (T) node[draw,pos=1,sloped, anchor = north east]{}node[pos=1.08]{$T$};

\coordinate (aux1) at ( $ (Q)!7pt!90:(R) $ );
\coordinate (aux2) at ( $ (R)!7pt!-90:(Q) $ );

\coordinate (aux3) at ( $ (O)!7pt!90:(T) $ );
\coordinate (aux4) at ( $ (T)!7pt!-90:(O) $ );

\draw[|<->|,>=latex]
  (aux1)  -- node[fill=white,sloped] {\SI{24}{\cm}} (aux2);
\draw[|<->|,>=latex]
  (aux3)  -- node[fill=white,sloped] {\SI{12}{\cm}} (aux4);
\end{tikzpicture}

\end{document}

enter image description here