答案1
想起来很简单。不需要高级软件包。
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[>=latex]
\draw[<->] (-5,0) node[left] {$X'$} -- (5,0) node[right] {$X$};
\draw[<->] (0,-5) node[below] {$Y'$} -- (0,5) node[above] {$Y$};
\draw (-4,0) -- (0,2.5);
\draw[|<->] (-4,-.2) -- (0,-.2) node[midway,below] {$80$};
\draw[|<->] (.2,2.5) -- (.2,0) node[midway,right] {$50$};
\draw (-.2,0) |- (0,.2);
\end{tikzpicture}
\end{document}
答案2
tkz-euclide 不太复杂。最新版本的 beta 是这里
\documentclass[border=.25cm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-5,ymin=-2,xmax=2,ymax=3]
\tkzDrawXY[noticks]
\tkzDefPoints{-4/0/A,0/0/O,0/2.5/B}
\tkzDrawPolygon(A,O,B)
\tkzMarkRightAngle(A,O,B)
\tkzDrawSegment[dim={$80$,-16pt,below=6pt}](A,O)
\tkzDrawSegment[dim={$50$,16pt,right=6pt}](B,O)
\end{tikzpicture}
\end{document}