2

What i have done so far:

\documentclass[11pt,a4paper]{article}
 \usepackage{tikz}
 \usepackage{tkz-euclide}
 \usetkzobj{all}
  \begin{document}
  \begin{center}
\begin{tikzpicture}

\tkzDefPoint(2,3.5){A}
\tkzDefPoint(0,0){B}
\tkzDefPoint(4,0){C}

\tkzDrawSegments(A,B B,C A,C)
\tkzLabelPoints[above,yshift=0pt](A)
\tkzLabelPoints[left,yshift=4pt](B)
\tkzLabelPoints[right,yshift=4pt](C)

\tkzDefMidPoint(A,B) \tkzGetPoint{x}
\tkzDefLine[orthogonal=through x](A,B) 

\tkzDefMidPoint(A,C) \tkzGetPoint{y}
\tkzDefLine[orthogonal=through y](A,C) 

\tkzDrawLines(x,y)
\tkzLabelPoints[above,xshift=-2mm](x)
\tkzLabelPoints[above,xshift=2mm](y)
\end{tikzpicture}

\end{center}
 \end{document}

Question: When you compile this, you will see that i successfully find two midpoints x and y of segment AB and AC respectively. The problem is the line passing through these two midpoints is slightly crossing both sides and i don't want this, i mean i am looking for only a segment between midpoints.

2

Simply replace \tkzDrawLines(x,y) with \tkzDrawSegment(x,y) to get this:

enter image description here

  • ohh...................... it was very simple. why i couldn't think. ok no problem and thanks a lot – Maths4Sandy Mar 23 '16 at 11:06
  • @snehal No problem! Also, you don't need all the \tkzDefLines because the coordinates for the segment are already defined. :) – Alenanno Mar 23 '16 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.