2

I am using tkz-euclide to draw a line inside the triangle, which I would like to label with (say) M (but I only know how to label points). How can I do this?

This is what I have so far:

enter image description here

\documentclass[11pt,a4paper]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
\tkzAxeXY

\tkzDefPoint[label=below:{$A$}](-1,-1){A}
\tkzDefPoint[label=right:{$B$}](3,1){B}
\tkzDefPoint[label=above:{$C$}](1,2){C}
\tkzDrawSegments(A,B B,C C,A)
\tkzDefPointBy[projection=onto A--C](B)

\tkzDefPoint[label=right:{$bc$}](2,1.5){BC}

\tkzDrawSegments(A,BC)

\end{tikzpicture}
\end{document}

1 Answer 1

2

You can do it with \tkzLabelSegment.

I took the liberty to adjust also the bc label:

\documentclass[11pt,a4paper]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
    \begin{tikzpicture}
    \tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
    \tkzAxeXY

    \tkzDefPoint[label=below:{$A$}](-1,-1){A}
    \tkzDefPoint[label=right:{$B$}](3,1){B}
    \tkzDefPoint[label=above:{$C$}](1,2){C}
    \tkzDrawSegments(A,B B,C C,A)
    \tkzDefPointBy[projection=onto A--C](B)

    \tkzDefPoint(2,1.5){BC}
    \tkzLabelSegment[above right=-2pt and -2pt](B,C){$bc$}  
    \tkzDrawSegments(A,BC)
    \tkzLabelSegment[above=1pt](A,BC){$M$}  

    \end{tikzpicture}
\end{document}

enter image description here

1
  • @StudentType You're welcome, thank you for accepting my answer!
    – CarLaTeX
    Commented Jun 25, 2017 at 7:37

You must log in to answer this question.

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