Creating a right triangle in Cartesian plane in LaTeX

1 reply · 3K views · last reply
cbarker1
Gold Member
MHB
Messages
345
Reaction score
23
Dear everybody,

I am trying to create a right triangle in Cartesian plane with no grid lines in Latex. I have no way to start it. I am having a hard time. I want to use tikz picture.

Thanks,
cbarker1
 
Last edited:
By "Cartesian plane with no grid lines", do you mean you want to show the x- and y-axes?

If so, try this:

Code:
\begin{tikzpicture}
            \draw[<->, line width=1pt] (-1.22,0) -- (3.22,0) node[right] {$x$};
            \draw[<->, line width=1pt] (0,-1.22) -- (0,4.22) node[above] {$y$};
            \draw (1,1) -- (2,1) -- (1,3) -- cycle;
\end{tikzpicture}

The first two draw commands draw the x- and y-axes, respectively, and the final draw command draws the right triangle.

The manual for TikZ is linked to from its CTAN page. You can find good examples there to help you refine your diagram.