Creating a right triangle in Cartesian plane in LaTeX

  • #1
cbarker1
Gold Member
MHB
349
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:
Physics news on Phys.org
  • #2
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.
 
  • Informative
Likes berkeman

Similar threads

Replies
3
Views
3K
Replies
9
Views
2K
Replies
3
Views
1K
Replies
12
Views
2K
Replies
6
Views
2K
Replies
3
Views
2K
Replies
1
Views
1K
Replies
1
Views
1K
Back
Top