How to Mark Right Angle in Tikz
You can use also tkz-euclide
:
\documentclass[11pt]{exam}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (-5, 0) {};
\coordinate (B) at (5, 0) {};
\coordinate (C) at (0, 5) {};
\coordinate (0) at (0, 0) {};
% left angle
\tkzMarkRightAngle[draw=blue,size=.7](A,0,C);
\tkzLabelAngle[dist=.5](A,0,C){$\alpha$};
% right angle
\tkzMarkRightAngle[draw=red,size=.7](B,0,C);
\tkzLabelAngle[dist=.5](B,0,C){$\beta$};
% axis lines
\tkzDrawLines[add=0 and 0, arrows=->](A,B 0,C)
\end{tikzpicture}
\end{document}
You can use perpendicular
syntax. It saves typing the coordinate at corner.
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (0,0) -- (0,5);
\draw (-.3,0)|-(0,.3) (0,.5)-|(.5,0);
\end{tikzpicture}
\end{document}