5

This is an image I want to draw.

enter image description here

And this is what I got so far.

enter image description here

\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}

      \begin{tikzpicture}
        \tkzDefPoint(0,0){A}
        \tkzDefPoint(2,0){B}
        \tkzDefPoint(2,5){C}
        \tkzDefPoint(0,4){D}
        \tkzDrawPolygon[fill=gray!10](A,B,C,D)
        \tkzLabelPoints(A)[anchor=east]{$A$}
        \tkzLabelPoints(B)[anchor=west]{$B$}
        \tkzLabelPoints(C)[anchor=south]{$C$}
        \tkzLabelPoints(D)[anchor=east]{$D$}
        \tkzMarkRightAngle(D,A,B)
        \tkzLabelSegment[above](A,C){$1$\,cm}
        \tkzLabelSegment[left=4pt](B,A){$x$\,cm}
        \tkzLabelSegment[right](C,B){$y$\,cm}
      \end{tikzpicture}

\end{document}

What am I doing wrong?

I appreciate your help.

1 Answer 1

8
\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}

      \begin{tikzpicture}
        \tkzDefPoint(0,0){A}
        \tkzDefPoint(2,0){B}
        \tkzDefPoint(2,5){C}
        \tkzDefPoint(0,4){D}

        \tkzDrawPolygon[fill=gray!10](A,B,C,D)

       \tkzLabelPoints(B,C)
       \tkzLabelPoints[below left](A)
       \tkzLabelPoints[below left](D)

        \tkzDrawSegment(D,B)
        \tkzMarkRightAngle(C,D,B)

       \tkzLabelSegment[above=4pt](D,C){$1$\,cm}
       \tkzLabelSegment[left=4pt](D,A){$2$\,cm}
       \tkzLabelSegment[below](A,B){$1$\,cm}
       \tkzLabelSegment[right](B,C){$x$\,cm}
       \tkzLabelSegment[right](D,B){$y$\,cm}
      \end{tikzpicture}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .