# How can I mark right angles in tkz-euclide on extended line?

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

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\coordinate (u) at (-2,-2);
\coordinate (v) at (9,8);
\clip  (u) rectangle (v);
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDrawPolygon(A,B,C)
\tkzLabelSegment[below](A,B){}
\tkzLabelSegment[above left](A,C){}
\tkzLabelSegment[above right](B,C){}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzMarkRightAngle(A,F,C)
\end{tikzpicture}
\end{document}


Rotate a point say "A" around "F" 90 degree and call it "H" by \tkzDefPointBy[rotation in rad= center F angle pi/2](A)\tkzGetPoint{H}. Now you can mark it.

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

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\coordinate (u) at (-2,-2);
\coordinate (v) at (9,8);
\clip  (u) rectangle (v);
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDrawPolygon(A,B,C)
\tkzLabelSegment[below](A,B){}
\tkzLabelSegment[above left](A,C){}
\tkzLabelSegment[above right](B,C){}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzMarkRightAngle(A,F,C)
\tkzDefPointBy[rotation in rad= center F angle pi/2](A)\tkzGetPoint{H}
\tkzMarkRightAngle(B,F,H)
\end{tikzpicture}
\end{document}


I think it's preferable to use the last version of tkz-euclide. Actually it's 3.05 on CTAN.

You have several solutions with the last version. With the new version, the simplest is to get a point on the line CF. You can do this with:

\tkzDefPointOnLine[pos=1.2](C,F) \tkzGetPoint{x} pos is a TikZ's option

Some remarks : With version 3.05 you don't need %\usetkzobj{all}, you don't need to clip a rectangle to control the boundingbox.

You have other solutions: like 'tkzDefPointWith[orthogonal ... '

\documentclass{standalone}
\usepackage{tkz-euclide}
%\usetkzobj{all} % you don't need this line with the last version 3.05

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDefPointOnLine[pos=1.2](C,F) \tkzGetPoint{x}

\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)

\tkzDrawPolygon(A,B,C)
\tkzLabelSegment[below](A,B){}
\tkzLabelSegment[above left](A,C){}
\tkzLabelSegment[above right](B,C){}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)

\tkzMarkRightAngle(A,F,C)
\tkzMarkRightAngle(x,F,B)
\end{tikzpicture}
\end{document}


Here another solution to get the points E,D,F here H_A H_B and H_C. I show you how to get the point a ( out of ABC )

\documentclass{standalone}
\usepackage{tkz-euclide}

\begin{document}
\begin{tikzpicture}[scale=1]
\tkzDefPoints{1/5/A,0/0/B,7/0/C}
\tkzDefSpcTriangle[orthic](A,B,C){H_A,H_B,H_C}
\tkzOrthoCenter(A,B,C)  \tkzGetPoint{H}
\tkzDrawPolygon[red](A,B,C)
\tkzDrawSegments(A,H_A B,H_B C,H_C)

\tkzLabelPoints[red](C)
\tkzLabelPoints[left,red](B)
\tkzLabelPoints[red,above](A)
\tkzMarkRightAngles[fill=gray!20,opacity=.5](A,H_A,C B,H_B,A C,H_C,A)
\tkzDrawPoints[red](A,B,C)
\tkzDrawPoints[blue](H_A,H_B,H_C)
\tkzDrawPolygon[red,fill=red!20,opacity=.3](A,B,C)
\tkzDrawPolygon[blue,fill=blue!20,opacity=.3](H_A,H_B,H_C)
\tkzLabelPoints[blue](H_A)
\tkzLabelPoints[blue,above left](H_C)
\tkzLabelPoints[blue,above right](H_B)
\tkzDefPointWith[orthogonal,normed](H_A,B) \tkzGetPoint{a}
\tkzDrawPoint(a)
\end{tikzpicture}
\end{document}


Just for fun!

import psteuclasy; //https://github.com/justonly011298/test-tkz-euclide
size(300);
unitsize(1cm);
real a=8,b=7,c=6;
pair A=(0,0),B=(c,0), C=pstInterCC(A,b,B,a)[1];
pair F=pstProjection(A,B,C),D=pstProjection(B,C,A),E=pstProjection(A,C,B);

pstRightAngle(C,F,A);
pstRightAngle(pstRotation(90,F,A),F,B);
draw(A--B--C--cycle);
draw(pstLineAB(C,F,0,-1)^^pstLineAB(A,D,0,-1)^^pstLineAB(B,E,0,-1),dashed);

dot("$A$",A,dir(-135),Fill(white));
dot("$B$",B,dir(-45),Fill(white));
dot("$C$",C,dir(90),Fill(white));