TikZ compiles the following code and renders a line segment with endpoints $A$ and $C$ and with a point $B$ between these endpoints. It also marks the length of $\overline{AB}$ as $x$ and the length of $\overline{BC}$ as $y$.
Above this diagram, I would like to have the length of $\overline{AC}$ marked as $z$. The following is a description of how it should be marked. A "|" should be drawn above the endpoints, a line with arrowheads between the two "|" should be drawn, and the letter "z" should be set in the middle of this line. (I think the overlay command is used to set the letter "z".)
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
\tikzset{
mydot/.style={
fill,
circle,
inner sep=1.5pt
}
}
\path (150:4.5) coordinate (A) (150:1.5) coordinate (B) (0:0) coordinate (C);
\draw (A)
-- (B) node [midway, above]{$x$} -- (C) node [midway, above]{$y$} -- (A) -- cycle;
\node[mydot,label={below left:$A$}] at (A) {};
\node[mydot,label={below left:$B$}] at (B) {};
\node[mydot,label={below left:$C$}] at (C) {};
\end{tikzpicture}
\end{document}
